HTML Formatting
HTML formatting elements are used to define how text should appear on a web page. These elements allow you to highlight important content, emphasize text, and improve readability for users.
HTML <b> and <strong> Elements
The <b> element makes text bold without adding extra importance.
The <strong> element represents important text and is also bold.
HTML <i> and <em> Elements
The <i> element displays text in italic style without emphasis.
The <em> element emphasizes text and is typically displayed in italics.
HTML <u> Elements
The <u> element underlines text.
It should be used carefully because underlined text is often confused with links.
HTML <small> Elements
The <small> element defines smaller text, often used for notes or disclaimers.
HTML <mark> Elements
The <mark> element highlights text with a background color.
HTML <del> and <ins> Elements
The <del> element shows deleted text, usually displayed with a line through it.
<ins> element shows inserted text, often underlined.
HTML <sub> Elements
The <sub> element displays text as subscript.
HTML <sup> Elements
The <sup> element displays text as superscript.
Formatting Best Practices
- Use
<strong>and<em>for meaning, not just styling - Avoid excessive formatting
- Keep text readable and clean
- Use CSS for visual styling when possible
Common Formatting Mistakes
- Using formatting tags only for design
- Overusing bold or italic text
- Mixing formatting styles unnecessarily
- Ignoring semantic meaning