HTML 标签用于以斜体样式显示内容,通常用于不同语言中的重要单词以及技术术语。如果我们在段落元素中编写内容,但内容中出现了重要的单词或不同的语言,我们可以使用 标签来突出显示重要单词。
语法
content
属性
标签支持 HTML 的 全局属性 和 事件属性。
标签示例
在下面的例子中,我们将看到 i 元素的不同例子。每个示例都将说明html i标签的用例。
指定斜体元素
在下面的示例中,让我们看看 标签在 HTML 文档中的用法。
This one is italic text
I looked at it and thought
This can't be real!
The term bandwidth describes the measure
of how much information can pass through a data connection
in a given amount of time.
设置斜体元素样式
考虑以下示例,我们正在创建一个 HTML 文档并使用 标签创建斜体文本,并使用 style 属性使斜体文本具有样式。
i {
color: red;
}
This one is italic text
I looked at it and thought
This can't be real!
The term bandwidth describes the measure
of how much information can pass through a data connection
in a given amount of time.
使用斜体元素指示差异语言
让我们看一下另一种情况,我们将在文本中使用 来表示它是不同的语言。
i {
color: red;
}
The Latin phrase Veni, vidi,
vici is often mentioned in music, art,
and literature.
HTML 标签用法
当没有更合适的语义元素时,在任何文本上使用 标签。例如 、、、 和 标签。
支持的浏览器
浏览器
Yes
Yes
Yes
Yes
Yes
<< HTML - em 标签
HTML - ins 标签 >>