Sub-item declaration
After understanding the basic statements and the overall statement, I want to talk about the sub-item Declaration. I don't need to talk about it much, because there is no special usage. Let's take a look at the following example:
| The code is as follows: |
Copy code |
<Style type = "text/CSS"> Body {font-size: 9pt; font-color: red} Body {font-family:; background: white} </Style>
|
You will find that we have made two declarations on the tag at the same time, right! This is the sub-item declaration we will talk about today. That is to say, we can make two different declarations for the same tag. In CSS, this is acceptable! How can this be done? Or more flexible? It depends on your usage habits! Basically, everyone's CSS Writing habits are different.
Be careful with the following situations:
In the sub-item declaration, pay special attention to the following situations:
| The code is as follows: |
Copy code |
<Style type = "text/css"> Body {font-size: 9pt; font-color: red} Body {font-family:; font-color: blue} </Style>
|
You found the red part! When a tag is declared as a sub-item, the style attributes in the result are the same (the font-color attributes are the same, but the set values are different). What will happen to the result? The text wrapped in labels is displayed in blue. You can try it!