Adding Semantic Value with Inline Elements

In addition to links, there are a number of other inline elements that can lend nuances of meaning to content. These elements are summarized in Table 8-1.

Table 8-1. A survey of HTML 4 inline elements

Element

Long name

“Presentation” equivalent

Notes

em

emphasis

i, u

 

strong

strong emphasis

b

 

cite

source citation

i

Applied to titles of books, periodicals, broadcast program series, and long form audio/visual media, but not to other proper names

code

code passage

tt

cf. kbd, samp

kbd

user-supplied keyboard input

tt

 

samp

program output sample

tt

According to the HTML 4.01 specification, distinguished from code by the fact that code content implies executability, while samp refers to program output

abbr

abbreviation

[none]

 

acronym

acronym

[none]

Acronyms and abbreviations expand in mutually exclusive ways; acronyms are formatted differently from one country to the next

sup

superscript

[none]

Best assigned an infinitesimal line-height value

sub

subscript

[none]

 

ins

insertion

[none]

Styled with an underline, by default

del

deletion

strike

Best followed by content within ins, in cases where “backspace and overstrike” is implied

q

inline quote

[none]

Behavior varies by user agent; prefer blockquote for long quoted passages

var

variable; irrational number

i

E.g., 2πr, (sin2θ + cos2θ) = 1

dfn

definition

i and em (in context)

Marks up terms that are presented inline to their definition, as a complement to definition lists (Definition Lists); especially effective when assigned an id

Get HTML & CSS: The Good Parts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.