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