Home>Article>Web Front-end> How to set html font size

How to set html font size

coldplay.xixi
coldplay.xixi Original
2021-03-26 15:27:10 15866browse

How to set the font size of html: 1. Add the px value after [font-size]; 2. inherit the font size of the parent element; 3. Based on the size of the parent element, perform percentage adjust.

How to set html font size

The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.

How to set html font size:

1. The first method: add px value after font-size

How to set html font size

2. As shown in the figure, the larger the px, the larger the font size

How to set html font size

3. The second type: inherit, inherit the font size of the parent element, such as If the parent element is 10px, then the child element is also 10px

How to set html font size

4. The third type: several fixed values (the default value is medium):

xx-small、x-small、small、medium、large、x-large、xx-large

How to set html font size

5. The fourth type: smaller and larger

These two are relative to the size of the parent element

How to set html font size

6. The fifth type: the form of percentage

The percentage is also adjusted based on the size of the parent element

How to set html font size

Related learning recommendations :html video tutorial

The above is the detailed content of How to set html font size. 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