liveBook · Manning

Alt-text

As explained in Build a Website with ChatGPT

Semantic alternative text is prose marked as having a different voice, mood, or role from the surrounding regular text.

Alternative text is a word or phrase whose voice, mood, or role differs from the surrounding prose. In HTML, mark this kind of semantic text with the <i> element. Browsers normally render the marked text in italics. section 12.2.6

Use it for text that is not simply regular narrative, such as book and movie titles, publication names, technical terms, foreign words or phrases, and a person’s thoughts. The italics signal the text’s distinct role to readers. section 12.2.6

Marking up a book title

Place <i> before the alternative text and </i> after it: <p>Let's visit the land of Narnia, first introduced to us by C.S. Lewis in <i>The Lion, the Witch, and the Wardrobe</i> (1950).</p> section 12.2.6

Do not confuse <i> with <em> or <strong>. Use <em> when words need added stress, and use <strong> when text is inherently crucial. Text-level elements can be nested when more than one meaning applies. section 12.2.6

<p>
    Let's visit the land of Narnia, first introduced to us by 
    C.S. Lewis in <i>The Lion, the Witch, and the Wardrobe</i> (1950).
</p>

This example shows an <i> element surrounding a book title within an ordinary paragraph. section 12.2.6

How Build a Website with ChatGPT covers it

How deep it goes
Defines the semantic purpose, gives common categories and HTML markup, and notes nesting with other text-level elements.
Examples
Uses a Narnia book title, plus publication names, technical terms, foreign phrases, and thoughts.
What it assumes
Teaches the i element directly while assuming only a need to mark words within prose.
What you can do after
Apply it via the HTML i element to mark text with a distinct semantic role.
How it connects
Distinguishes alternative text from emphasis, strong importance, and other semantic text.

Also explained in

Compare how 4 books explain alt-text →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Website with ChatGPT. The section links point to the parts of the book it draws on.