About the font size of a Web page

Source: Internet
Author: User
Tags relative
Web page | Size of question size?
A lot of discussion in the forum, about pixle good or point good? I will not repeat, here I would like to propose is the size of the font sizes in CSS, there are many different units, roughly three categories,

Absolute size: mm, CM, in, PT, PC
Relative size: Em, ex
Relative to device: px
may have to say a few more words is EM and ex,em in CSS is the size of the font size, for example, for the font of PT, 1 em equals pt example:

p {
font-size:10pt;
Text-indent:1em
}

Perhaps you would say I can use text-indent:10pt to achieve the same effect ah, but that's only in the ideal situation, if the user thinks his browser set the font size of 14pt better, the proportion you designed is lost, so the relative size of the Web page scalability design is very advantageous.

Ex and EM are similar, but not the same, back to the diagram above, x-height is different for each font, ex is based on the x-height of the font to define the size of the font.

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.