<i>: The Idiomatic Text element - HTML: HyperText Markup Language 编辑

The HTML Idiomatic Text element (<i>) represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others. Historically, these have been presented using italicized type, which is the original source of the <i> naming of this element.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Content categoriesFlow content, phrasing content, palpable content.
Permitted contentPhrasing content.
Tag omissionNone, both the starting and ending tag are mandatory.
Permitted parentsAny element that accepts phrasing content.
Implicit ARIA roleNo corresponding role
Permitted ARIA rolesAny
DOM interfaceHTMLElement

Attributes

This element only includes the global attributes.

Usage notes

  • Use the <i> element for text that is set off from the normal prose for readability reasons. This would be a range of text with different semantic meaning than the surrounding text. Among the use cases for the <i> element are spans of text representing a different quality or mode of text, such as:
    • Alternative voice or mood
    • Taxonomic designations (such as the genus and species "Homo sapiens")
    • Idiomatic terms from another language (such as "et cetera"); these should include the lang attribute to identify the language
    • Technical terms
    • Transliterations
    • Thoughts (such as "She wondered,What is this writer talking about, anyway?")
    • Ship or vessel names in Western writing systems (such as "They searched the docks for the Empress of the Galaxy, the ship to which they were assigned.")
  • In earlier versions of the HTML specification, the <i> element was merely a presentational element used to display text in italics, much like the <b> element was used to display text in bold letters. This is no longer true, as these tags now define semantics rather than typographic appearance. A browser will typically still display the contents of the <i> element in italic type, but is, by definition, no longer required to do so. To display text in italic type, authors should use the CSS font-style property.
  • Be sure the text in question is not actually more appropriately marked up with another element.
    • Use <em> to indicate stress emphasis.
    • Use <strong> to indicate importance, seriousness, or urgency.
    • Use <mark> to indicate relevance.
    • Use <cite> to mark up the name of a work, such as a book, play, or song.
    • Use <dfn> to mark up the defining instance of a term.

Examples

This example demonstrates using the <i> element to mark text that is in another language.

<p>The Latin phrase <i>Veni, vidi, vici</i> is often
mentioned in music, art, and literature.</p>

Result

Specifications

SpecificationStatusComment
HTML Living Standard
The definition of '<i>' in that specification.
Living Standard
HTML5
The definition of '<i>' in that specification.
Recommendation
HTML 4.01 Specification
The definition of '<b>' in that specification.
Recommendation

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:84 次

字数:7866

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文