Flexible XHTML and CSS Webpage Design 1-font size Scheme

Source: Internet
Author: User
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 ??

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.