CSS Notes 1

Source: Internet
Author: User

1. Selector

Advanced selector, IE 6,IE7 are not compatible, IE6,IE7 is the only compatible descendant selector

such as Div span,--the descendant selector acts on all descendants, not direct descendants

2. Box

IE 6 and above in this way, solve the method, do not add padding to the element, but try to add the inner margin to the element's parent element or the outer margin added to the element's child elements

3. Positioning

Relative positioning: Moving relative to the original position, the element occupies the original space such as:

#myBox {

position:relative;

left:20px;

top:20px;

}

Absolute positioning: The position of absolute positioning is determined relative to the location of the nearest ancestor element, which is absolutely positioned out of the document flow

You can set the Z-index property to control the stacking order of these boxes, which can be set to negative numbers

4.! Important

Use! Important raise the importance of a style sheet to take precedence over it

div{

background-color:red;! Important

Background-color:green;

}

CSS Notes 1

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.