With character highlighting elements you can format sections to provide emphasis by designating an information type (such as a variable) or by using character formatting. Highlighting tags may be ignored by minimal implementations.
In-line character tagging falls left to right in the rendered flow of text. The tags do not cause a paragraph break, and may be used on sections of text within paragraphs. Whitespace between the opening and closing tags separates words.
All character highlighting elements have related closing tags and use this format:
This is <em>emphasized</em> text.
Level 1 implementations must render highlighted text distinctly
from plain text. Additionally,
em content must be rendered as
strong content, and
b content must rendered as
Highlighting elements are allowed within the content of other highlighting elements, but implementations are not required to render these nested highlighting elements distinctly from non-nested elements. For example, implementations may render these two cases identically:
plain <B>bold <I>italic</I></B>
plain <B>bold </B><I>italic</I>
Some character highlighting styles are more explicit than others about how they should be physically represented. Designate the information type rather than the character format wherever possible, unless for example it is necessary to refer to the formatting in the text as in "The italic parts are mandatory".
cite tag specifies a citation. Sections tagged with the
cite style typically display in italics.
code style indicates an example of code. typically
monospaced font. (Do not confuse with
dfn tag indicates the defining instance of a
em tag provides typographic emphasis, typically
i often give the same effect, use
em except in
the case that it is necessary to refer to the formatting in
the text, as in "The italic parts are mandatory". This
improves consistency between documents from various
sources if, for example, a reader prefers to use color in
stead of italics for emphasis.
kbd style indicates text typed by a user. It might
typically be used in an instruction manual.
samp type indicates a sequence of literal characters.
strike tag indicates "strike out" text, as in a
legal document. This tag is not widely supported.
strong tag provides strong typographic emphasis,
var tag indicates a variable name.
b tag specifies that the text be displayed in boldface,
where available, otherwise alternative mapping is
i tag specifies that the text be displayed in italic font
(or slanted if italic unavailable).
tt tag specifies that the text be displayed in
fixed-width typewriter font.
u tag specifies that the text be displayed as
This example shows how you might use highlighting elements in an HTML document:
This text contains an <em>emphasized</em> word.
<strong>Don't assume</strong> that it will be italic!
It was made with the <CODE>EM</CODE> element. A cite is
typically italic and has no formal necessary structure:
<cite>Moby Dick</cite> is a book title.