What is the use of the em tag in html?

醉折花枝作酒筹
Release: 2023-01-06 11:16:37
Original
5396 people have browsed it

In HTML, the function of the em tag is to tell the browser to express the text as emphasized content. The syntax format is "Content that needs emphasis". For all browsers, this means that this text should be displayed in italics.

What is the use of the em tag in html?

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

tag tells the browser to represent the text within it as emphasized content. For all browsers, this means displaying this text in italics.

Adding emphasis to text also requires skill. If you emphasize too much, some important phrases will be missed; if you emphasize too little, you won't really highlight the important parts. It's the same with condiments that it's best not to overuse the emphasis.

Although the contents modified by tags are currently displayed in italics, these contents also have a broader meaning. One day in the future, browsers may also use other special effects to Display highlighted text. If you only want to italicize text, use the tag. In addition, documents can also include cascading style definitions that change the display of text.

In addition to emphasis, consider using the tag when introducing new terms or as a set style when referencing a specific type of term or concept.

Grammar:

<em>需要强调的内容</em>
Copy after login

Example:

<html>

<head>
<title>我的第一个 HTML 页面</title>
</head>

<body>
<p>body 元素的内容会显示在浏览器中。</p>
<em>我的第一个 HTML 页面</em>
<p>title 元素的内容会显示在浏览器的标题栏中。</p>
</body>

</html>
Copy after login

Result:

What is the use of the em tag in html?

##Extended information:

Tip: We do not object to the use of this tag, but if you are only using this tag to achieve a certain visual effect, we recommend that you use CSS, which may achieve a richer effect.

All phrase tags:

What is the use of the em tag in html?

Recommended learning:

html video tutorial

The above is the detailed content of What is the use of the em tag in html?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!