Home > Web Front-end > Front-end Q&A > Which tag does html5 use to represent subscripts?

Which tag does html5 use to represent subscripts?

青灯夜游
Release: 2022-03-24 17:08:22
Original
3417 people have browsed it

The sub tag is used in html5 to represent subscripts. The sub tag can define subscript text, with the syntax "Subscript text"; the content in this tag will be displayed in the browser below the baseline, which is half the character height in the current text stream. Can be used to represent chemical formulas.

Which tag does html5 use to represent subscripts?

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

In html5, you can use the sub tag to represent subscripts.

The sub tag can define subscript text.

The subscript text will be displayed below the baseline that is half the height of the characters in the current text stream, but the font and size will be the same as the text in the current text stream. Subscripted text can be used to represent chemical formulas.

Syntax:

<sub>下标文本</sub>
Copy after login

If you want to define a superscript, you can use the tag.

Example:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
</head>
<body>

<p>这个文本包含 <sub>下标</sub>文本。</p>
<p>这个文本包含 <sup>上标</sup> 文本。</p>

</body>
</html>
Copy after login

Which tag does html5 use to represent subscripts?

[Related recommendations: html video tutorial, web front-end

The above is the detailed content of Which tag does html5 use to represent subscripts?. 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