How does CSS group selectors
This article mainly introduces the CSS how to group the selector related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this CSS how to group the selector article will have a harvest, let's take a look.
We probably group either the development of the determiner or the declaration.
If you hope that all H2 elements have a blood background and appear as blue text using a 28-pixel high Verdana font, you might write something like this:
H2 {font: 28px Verdana;} h2 {color: blue;} h2 {background: red;}
But the painstaking defense of the above practice is not high. It is extremely poor when we build a list for an element with multiple styles. Instead, we can group the declarations together:
H2 {font: 28px Verdana; color: white; background: black;}
This is exactly the same as the results of the previous three-row stylesheet.
Note that for fame grouping, it is necessary to use semicolons at the end of each statement. The reader ignores the blank characters in the stylesheet. Only a semicolon is added, that is, approximately without concern, the style is established in the following format:
H2 {font: 28px Verdana; color: blue; background: red;} this article on "how CSS groups selectors" ends here. Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to group selectors in CSS". If you want to learn more, you are welcome to follow the industry information channel.