Eighth Chapter Padding/border/margin
1, for the line containing only text , can change the line spacing in the property only line-height/font-size/vertical-align.
2. Apply negative margins to non-replacement elements in the row, and the left and right ends may overlap with other content.
3. The border is drawn above the background of the element. (Can be modified)
4, to put the unilateral attribute after the shorthand attribute, to prevent overwriting.
5, regardless of the border of the element in the line specifies what width, the element row height will not change, see 1.
Nineth Chapter Colors and backgrounds
1. If the border color is not declared, the foreground color or inherited color will be applied by default.
2, the application of background image, it is best to declare the background color .
3. When setting the position of the background map using the percentage value, the meaning of the percentage is to align the point of the percentage value of the element with the point of the image percent value .
4. The background image starts at the inner border of the upper left corner (also the inner margin).
5, change the background-position can change the location of the start of the tile .
Tenth chapter floating and positioning
1. When an element floats, the other content wraps around the element. Common content such as floating a img,p will be distributed around the IMG .
2. margin of floating element will not be merged .
3. The floating element extends to include all of its descendants floating elements, so the parent element is set to a floating element, and the floating element can all be contained within its parent element .
4. When the inline box overlaps with a floating element, its border background is displayed above the floating element, and when the block box overlaps a floating element, its border and background are displayed below the floating element, but the content is displayed above the floating element.
5. Clear applies to block-level elements, indicating that left or right or both does not allow floating elements .
6, in order to make a clear element of the top and a floating element between the bottom of a certain space, you can set a floating element Margin-bottom, to clear the element set Margin-top is not convenient (the reason for clearing the area).
7. For a non-root element, if the position value is absolute, the containing block is the nearest position value is not a static ancestor element .
8. Top/right/bottom/left applies to elements where the position value is not static. The margin boundary of the element contains the offset of the inner margin boundary (border) of the block relative to it.
9. Top:auto;left:auto in Position:absolute means that the element is positioned before it is positioned (where it should have been ).
10, let the absolute positioning of the picture Center display a method:
img { position: absolute; margin: auto Auto; Left: 0; Right: 0; top: 0; Bottom: 0; }
11, relative positioning if excessively limited, then bottom equals-top,right=-left.
CSS-CSS Authoritative Guide Study notes 6