iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

HTML Formatting

HTML provides a small set of elements for marking up text with extra meaning — bold, italic, emphasized, marked, deleted, and so on.

Formatting elements

ElementMeaningRenders as
<b>Visually bold, no extra importance.bold text
<strong>Strongly important.important text
<i>Visually italic — alternate voice, technical term.italic text
<em>Emphasized — stress when read aloud.emphasized text
<mark>Highlighted for reference.highlighted
<small>Side comment or fine print.small text
<del>Deleted text.removed
<ins>Inserted text.added
<sub>Subscript.H2O
<sup>Superscript.x2
Tip: Prefer <strong> and <em> over <b> and <i> when the text really is important or emphasized — screen readers change tone for them.

Example

Example
<!DOCTYPE html>
<html>
<head>
    <title>HTML Formatting</title>
</head>
<body>

<h1>HTML Formatting</h1>
<p>This is a demo page for the "HTML Formatting" lesson.</p>

</body>
</html>
Try it Yourself »

Exercise

Make this word semantically important so screen readers stress it.

<p>This is < >critical</ >.</p>

Test yourself

Q1. Semantic "this is important" wrapper is…
Q2. Strike-through deleted text uses…
Q3. H₂O uses…

Discussion

Loading…