HTML5 Text Formatting
HTML
What is Text Formatting in HTML?
Text formatting in HTML5 means using HTML tags to style or emphasize text on a webpage.
This helps you make text bold, italic, highlighted, subscript, superscript, etc. to improve readability and convey meaning.
Common HTML5 Text Formatting Tags
| Tag | Purpose | Example | 
|---|---|---|
<b> | Bold text (without importance) | Bold | 
<strong> | Strong importance (bold) | Important | 
<i> | Italic text (without emphasis) | Italic | 
<em> | Emphasized text (italic) | Emphasized | 
<mark> | Highlighted text | Highlight | 
<small> | Smaller text | Small | 
<del> | Deleted (strikethrough) text |  | 
<ins> | Inserted (underlined) text | New | 
<sub> | Subscript | H2O | 
<sup> | Superscript | E=mc2 | 
<u> | Underlined text | Underline | 
<abbr> | Abbreviation | HTML | 
When to use which?
- Use 
<strong>and<em>for meaning (important for screen readers & SEO). - Use 
<b>and<i>only for visual styling (no added importance). - Use 
<mark>to highlight search keywords or important text. - Use 
<del>and<ins>to show edits or corrections.