CSS Primer: Multiple Declarations of styles

Source: Internet
Author: User
Sub-item Declaration

After understanding the basic statement and the overall statement, now to talk about the sub-statement, this content is basically not much to say, because there is no special usage, see the following example to know:

<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! That's what we're going to talk about today, which means that for the same tag, oh, you can do two different statements, in CSS, that's OK! As for this is superfluous? Or is it more flexible? That depends on your usage habits! Basically, everyone's CSS writing habits are different.

Be careful with the following scenario:

In the sub-statement, 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 of it! The same tag to make a sub-declaration, the result of the style of the properties of a group is the same (Font-color property, but the set value is not the same), then the result? The text that is wrapped up in labels is shown in blue. Everyone can try!

The above is the CSS beginner: the content of the multiple declarations of style, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • 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.