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

How to set css font size

coldplay.xixi
Release: 2023-01-05 16:09:14
Original
28404 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template