HTML Formatting: A Complete Guide
Introduction: What Is HTML Formatting?
HTML formatting is used to style and structure text on a webpage so it becomes:
Easy to read
Visually clear
Meaningful for browsers, search engines, and screen readers
When you create a webpage, plain text alone is not enough.
HTML formatting helps you:
Highlight important words
Emphasize meaning
Display quotes, code, or special text
Improve accessibility and SEO
This guide explains HTML formatting tags step by step, written in a teacher-style, beginner-friendly tone, perfect for first-time learners.
What Is HTML Text Formatting?
HTML text formatting means using special HTML tags to change how text:
Looks (bold, italic, underline)
Behaves (deleted, inserted)
Communicates meaning (importance, emphasis)
👉 Formatting does not replace CSS, but it adds semantic meaning to text.
Common HTML Formatting Tags (Overview)
| Tag | Purpose |
|---|---|
<b> | Bold text (visual only) |
<strong> | Important text |
<i> | Italic text (visual only) |
<em> | Emphasized text |
<u> | Underlined text |
<mark> | Highlighted text |
<small> | Smaller text |
<del> | Deleted text |
<ins> | Inserted text |
<sub> | Subscript |
<sup> | Superscript |
<code> | Code text |
<pre> | Preformatted text |
<blockquote> | Long quotation |
<q> | Short quotation |
Bold Text: <b> vs <strong>
<b> – Bold (Visual Only)
<p>This is <b>bold</b> text.</p> <strong> – Important Text (Recommended)
<p>This is <strong>important</strong> text.</p> ✅ Difference
<b> | <strong> |
|---|---|
| Styling only | Meaning + styling |
| No SEO benefit | Better SEO & accessibility |
👉 Use <strong> when importance matters.
Italic Text: <i> vs <em>
<i> – Italic (Visual)
<p>This word is <i>italic</i>.</p> <em> – Emphasis (Semantic)
<p>This is <em>very important</em>.</p> 👉 Screen readers emphasize <em> text.
Underlined Text: <u>
<p>This is <u>underlined</u> text.</p> ⚠️ Use carefully—underlines can look like links.
Highlighted Text: <mark>
<p>This is <mark>highlighted</mark> text.</p> ✅ Commonly used for:
Search results
Important notes
Small Text: <small>
<p>Copyright <small>© 2025</small></p> Deleted and Inserted Text: <del> & <ins>
Deleted Text
<p>Price: <del>₹1000</del> ₹800</p> Inserted Text
<p><ins>New feature added</ins></p> 👉 Useful for updates and revisions.
Subscript and Superscript
Subscript (<sub>)
<p>H<sub>2</sub>O</p> Superscript (<sup>)
<p>10<sup>2</sup> = 100</p> Code Formatting: <code> and <pre>
Inline Code
<p>Use <code>console.log()</code> in JavaScript.</p> Preformatted Text
<pre>
function hello() {
return "Hello World";
} </pre> 👉 Preserves spaces and line breaks.
Quotations: <blockquote> and <q>
Long Quote
<blockquote>
Learning never exhausts the mind. </blockquote> Short Quote
<p>He said, <q>Practice daily</q>.</p>HTML Formatting vs CSS Styling
| HTML Formatting | CSS Styling |
|---|---|
| Adds meaning | Controls appearance |
| Semantic | Visual |
| Improves accessibility | Improves design |
👉 Best practice:
Use HTML for meaning, CSS for design.
Common Beginner Mistakes
- Using formatting tags only for styling
- Using
<b>instead of<strong> Overusing<u>and<mark>Ignoring semantic meaning- Formatting entire paragraphs unnecessarily
Best Practices for HTML Formatting
- Use semantic tags (
<strong>,<em>) - Keep formatting minimal
- Use CSS for design changes
- Focus on readability
- Think about accessibility
Accessibility & SEO Benefits
Screen readers understand semantic tags
Search engines identify important text
Content becomes more structured
Better user experience
👉 Proper formatting improves SEO indirectly.
FAQs: HTML Formatting
What is HTML formatting?
Using HTML tags to style and give meaning to text.
Is <b> deprecated?
No, but <strong> is preferred for importance.
Can I use CSS instead of formatting tags?
Yes, for styling—but semantic tags are still important.
Which formatting tag is best for emphasis?
<em>