Home  >  Article  >  Web Front-end  >  How to set the font style of html font tag? How to control text size using CSS

How to set the font style of html font tag? How to control text size using CSS

寻∝梦
寻∝梦Original
2018-08-21 14:23:4422290browse

How to set the font style for the font tag in html? The methods of using CSS to control text size are all here. This article is about you want to know how to set the font style and bold text in the html font tag, and how to use css to set the text size in the html font tag.

HTML Definition and usage of tag:

Specifies the font, font size, and font color of the text.

html Example of font tag

Specify text font, size and color: Set font style in

This is some text!
This is some text!
This is some text!

html ( Bold italics, etc.)

Method 1:

aaaaa

Method 2:


aaa

html Add b tag in font:

Tag specifies bold text

Example:

加粗文字

CSS sets the text size:

In the web page, pass the text size Size, highlighting the theme is one of the most commonly used methods. CSS controls the size of text through the font-size attribute. The value of this attribute includes relative size and absolute size.

Absolute size




文字大小



文字大小,0.5in

文字大小,0.5cm

文字大小,4mm

文字大小,12pt

文字大小,2pc

How to set the font style of html font tag? How to control text size using CSS

A total of 5 text sizes are set, all using absolute units, displayed on any resolution monitor Effects are absolute in size and will not change.

In addition, in addition to using physical units to set the absolute size of text, CSS also provides some absolute size keywords. As the value of font-size, there are 7 in total.




文字大小



文字大小,xx-small

文字大小,x-small

文字大小,small

文字大小,medium

文字大小,large

文字大小,x-large

文字大小,xx-large

Among them, the unit px represents pixels. Therefore, the display size is related to the size and resolution of the monitor. The use of % or em is the ratio relative to the parent mark. If the font of the parent mark is not set The size is relative to the browser's default value.

This article ends here. If you want to read the basic article, click here: What is the html font tag? Detailed introduction to the attributes of the tag

[Related recommendations]

html How to use the address tag? Detailed explanation of how to use the html address tag

How to use the html5 audio tag? HTML5 automatic playback implementation code example

The above is the detailed content of How to set the font style of html font tag? How to control text size using CSS. 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