padding,margin,float,position

padding: padding, border: border, margin: from the outside
a padding properties equivalent to padding-left, padding-right, padding-top, padding-bottom
after a box plus padding, border, margin, will hold the box Great;
border: 3px Black Solid corresponds
border-style: Solid;
border-Color: Red;
border-width: 3px; these three properties

margin: the vertical direction will appear margins combined, laminated small to large, the margins can collapse into
ul li have a later point, to be clear at this point, and needs a style: List-style: none;
INPUT {
border: none;
Outline: none;
}

Phenomenon floating element, float: left, right
of 0. The text wrapping
1. The flow out of the standard document (from left to right, top to bottom)
2. float against each other
3. The float shrinkage phenomenon
clear float floating belt damage to
1. the parent element to set a fixed height
disadvantages: use inflexible, and difficult to maintain post-
application: the height of the cartridge holder page region, such as fixed navigation bar
2. method interior
rule: after the last add a float empty block elements, and the property is set clear: both;
disadvantages: a redundant structure
3. the pseudo-element (selector) Clear
4, overflow: hidden; (the most used)
the BFC region, a rule: the BFC is calculated (block when the cassette stage) in height, the floating elements are also involved in the calculation


Relative positioning: position: relative
without departing from the standard document stream, the element can adjust
a reference point: the original positioning reference point
fixed Ding: position: fixed
elements are placed in a fixed position in the browser window, the window position is not the drag element change.

Guess you like

Origin www.cnblogs.com/xdsuannai/p/12243771.html