PX: Relative length, relative to screen resolution;
EM: Relative length units, relative to the font size of the text within the current object. If the font size of the current inline text is not artificially set, the default font size is relative to the browser.
The default font height for any browser is 16px. All non-adjustable browsers are compliant with: 1EM=16PX. So 12px=0.75em,10px=0.625em. To simplify the conversion of font-size, you need to declare font-size=62.5% in the body selector in the CSS, which makes the EM value 16px*62.5%=10px, so 12px=1.2em, 10px=1em, That means you just have to divide your original PX value by 10 and then put EM in as the unit.
REM is a new relative unit of CSS3 (root em, root em), and this unit has aroused widespread concern. What is the difference between this unit and EM? The difference is that when you use REM to set the font size for an element, it is still relative size, but relative to the HTML root element. This unit is a combination of relative size and absolute size of the advantages in one, through it can only modify the root elements in proportion to adjust all font size, but also to avoid the size of the font-layer composite chain reaction. Currently, in addition to IE8 and earlier versions, all browsers support REM. For browsers that do not support it, the workaround is simple enough to write an absolute unit statement. These browsers ignore font sizes that are set with REM. Here's an example:
p {font-size:14px; font-size:.875rem;}
REM is designed for responsive use.
To learn about float,
The reason for float removal is that float is out of the document stream and is subject to the following
1. Unable to open the parent element;
2. Affects the sibling node, if the sibling node is an inline element, then try to surround the float element;
If the sibling node is a block element, occlusion may occur.
One of the clear methods of float is to use pseudo inner before, after;
Header Nav:before, header nav:after{
width:0;
display:table;
Clear:both;
Content: "";
}
First about the record, the specific details continue to supplement ~ ~ ~ ...
CSS px, em, and rem; float and Clear (first study)