How to modify the font size of html: 1. Use the font tag with the syntax format "font text"; 2. Use the style attribute in the tag element containing the font text and add "font- size:value;" style is enough.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Method 1: Use the font tag
to specify the font, font size, and font color of the text.
Syntax for setting font color:
<font size="数值">字体文本</font>
The range of the size attribute value: a number from 1 to 7. The browser default is 3.
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <div>测试文本</div> <div><font size="5">测试文本</font></div> </body> </html>
Rendering:
##Method 2: Use “font-size: value; "Style
Example:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <div>测试文本</div> <div style="font-size: 30px;">测试文本</div> </body> </html>
Description | |
---|---|
##xx-small
| Set the font size to different sizes, from xx-small to xx-large.
Default value: medium. |
Set font-size to a smaller size than the parent element. | |
Set font-size to a larger size than the parent element. | |
Set font-size to a fixed value. | |
Set font-size to a percentage value based on the parent element. | |
Specifies that the font size should be inherited from the parent element. |
The above is the detailed content of How to change font size in html. For more information, please follow other related articles on the PHP Chinese website!