css size, the display attributes, and a floating floating and removal method

css size
width height
Line High-height line is composed of three parts, the pitch spacing of the text height, and equidistant from the vertical. So the text is centered.
Line-height: Once you have set the line high, the internal element must have content.
line-height: 3; the number x of high row current line height is the current font size value.
Display
this attribute specifies the elements show some form of
display: none; the current element is not displayed, do not take up space in the current
visibility: hidden; hide the current element, also occupy the current space.
display: block; current element displayed in the form of block-level elements, the row-level elements can often be converted into block-level elements.
display: inline; current element displayed in the form of row-level element, it can often be block-level element level conversion element rows.
display: inline-block; current element displayed in a row-level block, i.e., do not take up a row, width and height may be provided.

 

Float
float attribute values left / right
. 1, the floating element flow out of the document
2, the floating elements against each other (stream's layout)
floating element will be tightly abuts against a window if enough space behind the floating element wide, before he would be next to an element abuts, if the window is not enough space to his wide, before he will go against an element, if it is not enough to continue looking forward, not leapfrog go against, this arrangement is called flow's layout.
3, the floating element has a surround effect words
used in conjunction with graphics.
Clear float
floats out of the document flow, the document does not take up space, leading to the back of the elements will go on location followed by an element arranged our clear aim is to put an end to the floating occurrence of this phenomenon.
1, to set the height of the parent element;
2, after the last to add an empty element a floating element, set the properties Clear: both;
. 3, to the parent of the floating element is provided a class called clearfix
.clearfix: {After
Clear: both;
height : 0:
visiblity: hidden;
Content: "";
the display: Block;
}

 

Guess you like

Origin www.cnblogs.com/zhangyuxinxin/p/11912287.html