Home > Article > Web Front-end > How to set css font size
The way to set the css font size is to use the [font-size] attribute to set the font size. In fact, it sets the height of the character boxes in the font. The actual character glyphs may be taller or shorter than these boxes.
The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.
How to set font size in css:
css can use the font-size attribute to set the font size. In fact, it sets the height of the character box in the font; actually The character glyphs may be taller or shorter than these boxes (usually shorter).
Example
<html> <head> <style type="text/css"> h1 {font-size: 300%} h2 {font-size: 200%} p {font-size: 100%} </style> </head> <body> <h1>This is header 1</h1> <h2>This is header 2</h2> <p>This is a paragraph</p> </body> </html>
Rendering:
The above is the detailed content of How to set css font size. For more information, please follow other related articles on the PHP Chinese website!