Home  >  Article  >  Web Front-end  >  A beginner's introduction to CSS: multiple declarations of style

A beginner's introduction to CSS: multiple declarations of style

黄舟
黄舟Original
2016-12-19 16:22:091008browse

Sub-item statement

After understanding the basic statement and the overall statement, now let’s talk about the sub-item statement. Basically, there is no need to say more about this content, because there is no special usage. Just look at the following example:

You will find that we made two statements on the label at the same time, yes! This is the sub-declaration we are going to talk about today, that is to say, we can make two different declarations for the same tag. In CSS, this is okay! As for whether this is unnecessary? Or more flexible? That depends on your usage habits! Basically, everyone’s CSS writing habits are different.

Be careful of the following situations:

In the sub-declaration, there are situations that you need to pay special attention to, as follows:

You discovered the red part! If you make a sub-declaration on the same tag, the style attributes in it will be the same (the font-color attributes are the same, but the setting values ​​are different). So what will be the result? Text enclosed by labels is displayed in blue. Everyone can try it!

The above is the basic introduction to CSS: the content of multiple declarations of styles. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn