Home  >  Article  >  Web Front-end  >  How to change the font of tags in html

How to change the font of tags in html

青灯夜游
青灯夜游Original
2021-03-03 17:36:506324browse

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.

How to change the font of tags in html

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")

How to change the font of tags in html

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.

How to change the font of tags in html

css font-weight attribute

font-weight attribute sets the thickness of the text

How to change the font of tags in html

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn