Learn more about Web making technology CSS Property units

Source: Internet
Author: User
css| Web page

Because style sheet items are made up of attributes and their values, it is necessary to understand the various units of the property value. In CSS, the various units and in the HTML are different, please pay attention to distinguish between the reader.

1. Length Unit

Abbreviation Unit type description

CM cm
EM ems width of M letters in current font
Ex Exs the height of the X letter in the current font
in inch
mm mm
PC Picas 1 pica=12 Point
PT dot 1 dot =1/72 inch
PX Pixel display Unit

Note: Not all browsers support the above length units. For example: ie3.x does not support EM and ex units. NS4.0 does not support PC units.

In the units above, you need to explain EM and ex.

The height represented by "em" is the height of the capital letter "M" (or "H"), assuming that the font currently in use is number 12th, then EM is number 12th. In general, the default font for browsers is number 12th. If you change the default font size, the value of EM adjusts accordingly.

For example, assuming that the font size in the <H1> marker is 1.5em, the browser performs the following procedure when compiling HTML:
(1) Read the default font size value, such as number 12th;
(2) reading the relative definition value 1.5em;
(3) Display font number 18th (12pt X 1.5=18pt).

As you can see, the EM units are defined based on the default values of the user's browser, so that both Web designers and browsers have control over the size of the font-the designer can specify the proportions that need to be enlarged (or reduced), and the actual display size is selected by the user.



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.