Comparison of each unit of measurement used in web page production

Source: Internet
Author: User
Tags comparison
Compare | pages in a Web page the size of page elements is modified in addition to the numeric size, there is the choice of units of measure. What are the different units of measurement? First understand the various types of units and instructions

pixels (px)
According to the resolution of the monitor to determine the length, in the Web application more use of the unit;

points (PT)
Determines the length according to the font size defined by the Windows system;

inches (in), CM (cm) and mm (mm)
Determines the length according to the actual size of the display. Such units do not change with the resolution of the display;

12pt Word (PC)
That is, the Windows system-defined 12 font size is units ( 1pc=12pt)。 The number entered before the unit represents a multiple of the font size. such as {font-size:2pc;} Indicates that the text size is 24pt;

The above units are fixed values, changing the browser text size does not affect the use of these units of the text changes.

font height (em)
Represents the dimensions of the current text. such as {font-size:2em} refers to the text size is twice times the original;

height of font x (ex)
Represents the height of the current letter "X";

%
is to define the dimensions as a percentage of the current text. such as {font-size:200%} refers to the text size is twice times the original;

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "><ptml xmlns=" http://www.w3.org/1999/xhtml "><pead><meta http-equiv=" Content-type "content=" text/html; charset=gb2312 "/><title> page" </title><style type= "text/css" ><!--body {font-family: Verdana, Arial, Helvetica, Sans-serif; P {background-color: #EFEFEF; margin:5px; PADDING:4PX}. px12 {font-size:12px}. px14 {font-size:14px}. pt12 {font-size:12pt}. pt14 {font-size:14pt}. in1 {font-size:1in}. PC1 {font-size:1pc}. PC2 {font-size:2pc}. EM2 {font-size:2em}. Ex1 {Font-size:1ex}. EX2 {Font-size:2ex}. ex4 {Font-size:4ex}. Per2 {font-size:200%;} --></style></pead><body><p> Normal font size, <span class= "px12" >12 pixel (px) size </span>, <span class= "px14" >14 pixel size </span></p><p> normal font size, <span class= "pt12" >12 points (PT) Size </span>,<span class= "pt14" >14 number of points </span></p><p> normal font size, <span class= "in1" >1 inch (in) size </span>,</p><p> normal font size, <span class= "pt12" >12 points (PT) Size </span>= < Span class= "PC1" >1 12pt character (1pc) size </span>,<span class= "PC2" >2 12pt character (2pc) size </span></p> <p> Normal font size, <span class= "em2" >2 font height (em) size </span></p><p> normal font size, <span class= "Ex1" >cnbruce-ex1</span>,<span class= "Ex2" >cnbruce-ex2</span>,<span class= "ex4" > cnbruce-ex4</span></p><p> Normal font size, <span class= "per2" >200% font size </span></p>< /body></ptml>

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]



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.