Special characters in CSS

Source: Internet
Author: User

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

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.