CSS style Sheets

Source: Internet
Author: User

CSS style Sheets

/* Comment Area */This is a comment area and will not be read

One, style sheet

1, restrained style sheet: directly write into the attribute, with style (style) attribute to specify the display style

Vertical Center line-height height is div height

Horizontal Center Text-align:center

div Horizontal Center: margin:0xp (above) auto

2, embedded style sheet: As a separate area embedded in the Web page, must be written in the head tag inside.

p/* a style sheet named after the tag name, all such tags will be executed/

3. External style sheet: Create a new CSS file to place the style sheet. If you want to call the style sheet in an HTML file, you need to right-click the CSS style sheet in the HTML file and attach the style sheet. The link connection method is generally used.

*/* format works on all labels/margin: margin padding: pitch

Second, selector

1, Tag Selector, with tag name do selector.

p/* a style sheet named after the tag name, all such tags will be executed/

2, class selector, all with "." Beginning.

3. ID (uniquely OK) selector, beginning with "#".

4. Match selector.

(1) Use "," to separate the side-by-side, and two tags to perform one of the styles.

(2) separated by a space, indicating descendants.

. Main p/* in the label of the Class=main, if there is a P tag exists to execute P tag/

(3) filter ".".

p.sp/* the CLASS=SP tag in the label P, execute sp/

A-tag, linked style

A:link hyperlink is pre-state

a:visited Hyperlink post-click Status

A:hover Hover over hyperlinks

A:active When you click the hyperlink

CSS style Sheets

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.