1. For example, div {...} adds a style to all <div> </div> .
2. "#": Corresponds to the ID attribute of the tag in HTML, written as # Name . For example, # P1 {...} adds a style to <p id = "p1"> ID is P1 </P>. .
3. The first decimal point ".": corresponds to the class attribute of the tag in HTML, written as. Name . For example,. P2 {...} adds a style to <P class = "p2"> class is P2 </P>. .
4. The intermediate space "" is related to the HTML Tag hierarchy. It is written as CSS [CSS [... CSS] and can be set to multiple layers. . For example, div # P1. span1 {...}
the most internal span1 in
add sample .
the CSS written in this way must strictly abide by the CSS and HTML Tag layers. In the following cases, this CSS will not apply :
<Div> <SPAN class = "span1"> </span> </div>
5. Comma "," indicates the parallel relationship, That is The CSS has multiple names (the CSS style can be simplified and repeated)
such as body, form, div {...} adds a style for all ,
, and
6. colon after name": ": generally, status
For example,: hover indicates the style used when the mouse is hovering over a tag
7. the dot in the style represents the class, # represents the ID, you can also comment out
H1 indicates the elements in HTML
tr. HR indicates the child element of the element
original:
http://zhidao.baidu.com/question/200642163.html
Http://hi.baidu.com/wozengcong2012/item/efbd49a38712ffd95bf191b1