Often in our CSS style there will be several places to use the same settings, a separate write will be a tiring job, too high and too long to be redundant, more difficult to manage .... CSS syntax in the basic settings, you can put the same set of selectors together, the original may be written 7~8 line of the same grammar, together after just a small line, how to see all people relaxed and happy AH ~
For example: when there are several selectors just need to set the color of the text to Gray, a separate method of writing, the feeling is very cumbersome, as follows:
- h1 {color: #666666;}
- H2 {color: #666666;}
- h3 {color: #666666;}
- h4 {color: #666666;}
- UL {color: #666666;}
- p {color: #666666;}
- #AAA {color: #666666;}
- #BBB {color: #666666;}
Clustering: combine these selectors with commas , just a short line, as follows:
- H1, H2, H3, H4, UL, P, #AAA, #BBB {color: #666666;}
The use of "clustering" selector can make our CSS style more concise, the future and good management and convenient modification, this is the most basic CSS grammar of the function, as long as the basic use of this is familiar, students can naturally build a beautiful CSS style then ~