Careeroza
Formatting
Text Formatting Elements
| Element | Meaning |
|---|---|
<b> | bold text, no extra importance |
<strong> | important text (bold, and announced as important) |
<i> | italic text: a different voice, a term, a foreign word |
<em> | emphasized text (stress) |
<mark> | highlighted text |
<small> | smaller print, e.g. legal notes |
<del> / <ins> | deleted / inserted text |
<sub> / <sup> | subscript / superscript |
<code>, <kbd> | computer code, keyboard input |
Examples
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p><strong>Warning:</strong> this action cannot be undone.</p>
<p>You <em>must</em> save your work first.</p>
<p>Today's offer: <del>₹999</del> <ins>₹699</ins></p>
<p>H<sub>2</sub>O and E = mc<sup>2</sup></p>
<p>Search for <mark>HTML</mark> in the docs.</p>
<p>Press <kbd>Ctrl</kbd> + <kbd>S</kbd> to save.</p>
</body>
</html>Result
b vs strong
Tip: Choose the element for its meaning. <strong> and <em> carry meaning that screen readers can convey; <b> and <i> only change the look.