We can make our CSS little bit better, by Combine selectors in CSS,
We have to apply same font-family in all our H Selector. so lets combine all H selector for at least this property
Reason: At some Stage if wee wanted to change the font-family to something else,then we would have to go through all of these different rules and set the font-family then to something else there.
Method 1: using List of Selectors
- Create a list of selectors in order to select multiple elements and then apply this font-family to that list, essentially.
- Select the h1 element and the h2 element and the h3 element and even P or LI, and use comma between them- for all those having same font family
now we can remove color and font family from all above selectors.
Method 2: Using descendant selector
Select the footer element, then a space, and then the p selector. And so what this will do is it will select all the p elements that are inside of footer elements.
OR
Above will work if header directly exists in body element, if header comes inside article element then we have to use some thing like
A More Better way
Give some elements names and then use these names to select them? This helps us to control style of say 2nd header or second p inside article