CSS Primer: Multiple declarations of style

Source: Internet
Author: User
Css

  sub-item declaration

Having understood the basic statement and the overall statement, it is now time to talk about the sub-item, which is basically needless to say, because there is no particular use, and look at the following example:

<style type= "Text/css" >

Body{font-size:9pt; font-color:red}
Body{font-family: Song body ; Background:white}

</style>

You will find that we have made two statements on the label at the same time, yes! This is what we are going to say today, that is to say, on the same label, oh we can do two different statements, in CSS, this is OK! As for this is superfluous? Or is it more flexible? It depends on your habit of use! Basically, everyone's CSS writing habits are different.

  Be careful of the following situations:

In the sub-item, there is a case for special attention, as follows:

<style type= "Text/css" >

body{font-size:9pt; font-color:red}
Body{font-family: Song body; Font-color:blue}

</style>

You found the red part! The same label makes a partial declaration, the result inside the style of the attribute has a group is the same (Font-color property, but the set value is different), then what will be the result? The text that is wrapped in the label is displayed in blue. We can try!

Related Article

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.