Multiple declarations of CSS beginner style

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.