CSS entry notes three: font properties font

In CSS, all font attributes are set with font. The following attributes are commonly used:

1. Font family : font-family ; can be followed by multiple values, but the values ​​need to be separated by commas. When the computer does not have a font with the first value (such as Microsoft Yahei), the font with the second value will be selected , If there is no font with the second value, the third value will be selected.

2. Font size : font-size ; the attribute value is the pixel value, used to set the font size.

3. Font weight : font-weight ; set the thickness of the font, the attribute values ​​are normal, bold, bolder, etc., the specific information can be found in the document.

4. Font style: font-style ; used to set the font style, such as slant,

Compound writing method of text attributes : Write various attributes of text together to save code.

          font: 属性值1(style) 属性值2(weight) 属性值3(size) 
          		属性值4(family);	

The compound writing method using font attributes must retain the size (size) and family (series) attributes, and the other two attributes can be omitted if they are not needed.

Guess you like

Origin blog.csdn.net/m0_52021758/article/details/113026846