Home > Web Front-end > Front-end Q&A > What is the default font size of html5

What is the default font size of html5

WBOY
Release: 2022-04-28 13:41:19
Original
6640 people have browsed it

In HTML5, the default font size is determined by different browsers. The default font size of most browsers is 16px; you can use the style and "font-size" attributes to set the font size. The syntax is: "".

What is the default font size of html5

The operating environment of this article: Windows 10 system, html5 version, Dell G3 computer.

What is the default font size of html5

The default font size of most browsers is 16px. You can set the CSS font-size to change the font size.

<style> html,body{ font-size: 16px; } </style>
Copy after login

You can also set font-size:62.5% so that 1rem = 10px to agree on the font size.

For IE browser font calculation floating point number is not accurate, so it can be set to font-size:63%.

The example is as follows:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<p style="font-size:14px;">px</p>
<p>px</p>
</body>
</html>
Copy after login

Output result:

What is the default font size of html5

Recommended tutorial: "html video tutorial"

The above is the detailed content of What is the default font size of html5. 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