1. CSS Property Units :
(1) Length units : Includes absolute length units and relative length units
Absolute length units include: cm, MM, in, PT, PC, etc. Absolute length units are best used for print output devices, and absolute length values do not make sense when shown as a frequency screen only.
The relative length units are: px, EM, ex, etc. Relative length refers to the corresponding scaling of the element size relative to the browser's system default value. EM is the size of the font size relative to the text m in the current object. Ex is the size of the font size relative to the text x in the current object. If the font size of the text in the line is not artificially set, the default font size is relative to the browser.
Px,em, conversion of percent: 16px = 1em = 100% 1px = 0.0625em = 6.25%
(2) color Unit :
Expressed as percentages, such as Color:rgb (50%,0,50%);
Set with an integer value between 0-255, such as Color:rgb (128,0,127);
Defines a color using a hexadecimal array, such as color: #e1e1e1;
Defines a color using a simplified hexadecimal number, such as color: #fa1; equivalent to #ffaa11;
In the color of English, such as black, white, etc.
(3) URL Unit : The format is followed by a "url" followed by a parenthesis, in parentheses is the address of the URL.
2. Setting font for element content
(1) Set font name:font-family
Can be set such as Arial, Arial and other fonts. To use secure fonts such as Arial, Verdana, Arial, and so on, you cannot use remote fonts. Multiple fonts can be made at the same time, separated by commas, so the advantage is that if the computer does not have the first font, the browser can use the font specified later.
(2) font Tilt level : Font-style
Property values include Normal/italic/oblique
(3) variant of font : font-variant
Property values include Normal/small-caps. Uppercase letters in the font of elements that use the Small-caps property appear to be smaller than normal uppercase letters.
(4) character weight : font-weight
Property values include normal/bold/bolder/lighter/100/200/300/400/500/600/700/800/900. 400 equivalent to normal,700 equivalent to bold,900 is the heaviest font. Bolder or lighter indicates that the font's character weight is higher or lower than the parent element
(5) Font size : font-size
Property values include:< absolute size > (e.g. 12pt)/< relative size > (e.g. 1.5em)/< percent > (e.g. 150%)
(6) abbreviation for font properties : Font, attribute order is separated by spaces in {Font-style, font-variant, Font-weight, Font-size, font-family}. such as P{font:normal small-caps bold 120% Arial;}
CSS Basics 3--fonts that use CSS to format element content