Length units: CSS Length units

Source: Internet
Author: User
Tags relative
/c/2008/11/kiy1a50ewiiggr14.asp
CSS Length Units
In CSS, there are two types of length units, absolute length units and relative length units respectively.
Absolute length Unit
Absolute length units are divided into in (inches), cm (cm), mm (mm), pt (LB), PC (PICA). Among them, in (inches), cm (cm), mm (mm) and the actual common units are exactly the same. Focus on the PT (LB), PC (PICA).
PT (LB): is a commonly used unit in standard printing, with a length of 72pt of 1 inches.
PC (PICA): This is also a printing unit, with a 1pc length of 12 lbs.
Absolute length units, though easy to understand, are rarely used in the design of Web pages.
Relative length Units
The relative length unit is the maximum length unit used. including EM, ex, PX, described below separately.
EM is a value that defines the size of the text, which is the value of the Font-size property in the text. For example: To define the text size of an element of 12pt, then, for this element 1em is 12pt,2em is 24pt. The actual size of the unit EM is affected by the font size.
The ex is similar to EM, referring to the height of the letter x in the text, because the height of the x of the different fonts is different, so the actual size of the ex is affected by two factors of the font and font size.
PX is commonly referred to as the pixel, so that the page design uses the most units of length. Divide the display into very small squares, and each square is a pixel. On the surface it seems to be easy to understand, in fact, the specific size of PX is affected by the resolution of the screen, that is, and the way to divide the screen. For example, a font of 100px size, if the display uses the resolution of 800x600 pixels, the width of each word is 1/8 of the screen. If the resolution of the monitor is set to 1024x768 pixels, the same 100px font will have a width of 1/10 of the screen width.
This article links http://www.cxybl.com/html/wyzz/CSS/20120601/27377.html

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.