CSS base Reference way Tag Selector priority various layouts

Source: Internet
Author: User
Tags tag name

Today's CSS Foundation, understand the CSS is cascading table, is to beautify the page, control the style of the page.

Style Sheet Introduction Page 3 ways 1 inline, syntax example: <div style= "Width:100px;height:50px;background: #E91115" > </div> "

2 Inline syntax example (inside head) Div{height:100px;width:100px;background: #EF0E12}

3 external style sheet syntax example (inside head) <link rel= "stylesheet" href= "**.css>"

Selector 1 Tag Selector tag name {style}

2ID selector #id名 {style} (unique)

Class 3 selectors. Class name {} style} (can give any plus)

4 Combo Selector comma to comma-connected labels plus styles such as p,div{}

Empty Grieru ol space IL

Filter label name. Class Name


Property selector such as div[date= "div"]{}

Priority 1 within the label style= ""

2id Selector

Class 3 and attribute selectors

4body TD ..... Inside the

5* for all

Note: When the selector is the same, the following style is higher than the above.

Format Layout position:fixed fixed

Position:absolu Absolute Positioning

Position:relative relative positioning

Grammar: any one of position:3; Z-index 10;left or right =100px; top or botton=100px

CSS base Reference way Tag Selector priority various layouts

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.