ArticleDirectory
- First, understand the font units:
- Reference size plus percentage Model
- What are the benefits of using the reference size + percentage?
First, understand the font units:
Relative unit: pixel resolution relative to the device screen; em relative to the parent element; Ex relative to the letter X
Absolute unit: In inches; PT point distance; pc picas; cm; Mm mm
The absolute unit is too absolute. Give up ~
PX is mainstream, but IE does not support it well .. In ie, the "View" = "font size" switch does not respond.
Ex is too cold ..
Em is okay.
Reference size plus percentage Model
Font Size Control, in addition to using numbers and units, there are also keywords such as small, large and so on available. The solution described in this article is to use percentages to adjust the font size based on keywords. "Base-plus-percentage" for short )".
First, set the base font size for the body tag. For example, small
Second, other elements use percentages to control their font sizes relative to parent elements.
For example:
Body {font-size: small ;}
H1 {font-size: 150% ;}
H2 {font-size: 130% ;}
H3 {font-size: 120% ;}
Ul Li {font-size: 90% ;}
What are the benefits of using the reference size + percentage?
There is no problem with PX in IE...
After the baseline size is changed, other fonts are also changed.
Read new. Riders. Press. Bulletproof. Web. Design. jul.2005 and sort it out ~ What is the difference between reading and reading ??