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.