Analysis of definitions of CSS such as AA. CC and. AA. CC

Source: Internet
Author: User
In css definition, we sometimes encounter the definition methods of. AA. CC {} And. AA. CC {}. What are the differences between the two definitions?

CSS definition:
. AA. CC {
Background-color: yellow;
}
. AA {
Background-color: blue;
}
. CC {
Background-color: red;
}

Add the following structure to the webpage:Code, You can see different effects:

Webpage Structure Code 1:

<Div class = "">
<Div class = "AA cc"> text </div>
</Div>

Effect 1:

Webpage Structure Code 2:

<Div class = "AA">
<Div class = "cc"> text </div>
</Div>

Result 2:

. AA. CC is rarely used. definitions such as. AA. CC and P. AA are generally used.

. AA. CC is defined as a multi-value attribute, which is generally:
<Div class = "AA cc"> text </div>

. AA. CC is defined as include selector, which is generally:
<Div class = "AA">
<Div class = "cc"> text </div>
</Div>

P. AA is defined as the class selector (or the ID selector P # Aa), which is generally:
<P class = "cc"> text </P>
<P id = "cc"> text </P>

P. AA includes the selector definition, which is generally:
<P>
<Div class = "cc"> text </div>
</P>

Here we mainly want to understand the different CSS statements such as. AA. CC,. AA. CC, P. AA, and P. AA, and how to write them in the code structure of the webpage.

Note that both IE 6, IE 7, and FF are supported. AA. CSS definition of CC {}, but defined in IE 6. AA. CC ,. CC styles are also affected.

 

Transferred from: Yahoo

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.