Home>Article>Web Front-end> How to change the font of tags in html
htmlHow to change the label font: 1. Use the font-family attribute to change the font family; 2. Use the font-style attribute to change the font style, such as italics, italic text, etc.; 3. Use the font-size attribute to change The size of the font; 4. Use the font-weight attribute to change the thickness of the font.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
CSS font properties define font, bold, size, and text style.
css font-family property
In CSS, there are two types of font family names:
Universal fonts Family - A grouping of font systems that share a similar appearance (such as "Serif" or "Monospace")
Specific font family - A specific font family (such as "Times" or "Courier")
The font-family property sets the font family of the text.
The font-family property should set several font names as a "fallback" mechanism, if the browser does not support the first font, he will try the next font.
Note: If the name of the font family is more than one character, it must be in quotation marks, such as Font Family: "宋体".
css font-style attribute
is mainly used to specify the font style attribute of italic text.
This attribute has three values:
Normal - Display text normally
Italic - Display text in italics
Slanted text - the text is tilted to one side (very similar to italics, but not very supported)
p.normal {font-style:normal;} p.italic {font-style:italic;} p.oblique {font-style:oblique;}
[Recommended tutorial:CSS video tutorial】
css font-size property
font-size property sets the size of the text.
css font-weight attribute
font-weight attribute sets the thickness of the text
For more programming-related knowledge, please visit:Programming Video! !
The above is the detailed content of How to change the font of tags in html. For more information, please follow other related articles on the PHP Chinese website!