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