Example code

html-css

#1

can anyone give a example code to this notee
"For instance, imagine a page with two headlines. One headline needs to be bold and blue, and the other needs to be bold and green. Instead of writing separate CSS rules for each headline that repeat each other’s code, it’s better to write a .bold CSS rule, a .green CSS rule, and a .blue CSS rule. Then you can give one headline the bold green classes, and the other the bold blue classes."


#2

is this an exercise ?
.green {color:green}
.blue{color:blue}
.bold{font-weight:bold}


#3

Opinions may vary; I’m on the side that says the above is NOT how to write CSS, but that’s my view.

Classes should not be distinguished by color or font style but by purpose and role. Within the definition of the role, properties are given to their respective classes. If color: green happens to show up in more than one selector rule it is not a deal breaker.