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

How to set css font size

coldplay.xixi
coldplay.xixiOriginal
2021-04-16 15:17:3128337browse

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.

How to set css font size

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:

How to set css font size

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!

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