Home > Web Front-end > Front-end Q&A > How to change the font of tags in html

How to change the font of tags in html

青灯夜游
Release: 2023-01-03 09:27:29
Original
6445 people have browsed it

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;}
Copy after login

[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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template