HTML Text Formatting

Master the art of semantic text formatting and typography for better readability and accessibility

Proper text formatting enhances user experience, improves accessibility, and helps search engines understand your content structure.

šŸ”¤

Basic Text Formatting Tags

Semantic Text Emphasis

<strong>Strong

Important text with semantic meaning

This is <strong>important</strong> text
This is important text
Visual equivalent: This is **important** text
Screen readers emphasize content
<em>Emphasis

Emphasized text with semantic meaning

This is <em>emphasized</em> text
This is emphasized text
Visual equivalent: This is *emphasized* text
Screen readers stress content
<mark>Mark

Highlighted text for reference

This is <mark>highlighted</mark> text
This is highlighted text
Visual equivalent: This is ==highlighted== text
Search results, important notes
<small>Small

Side comments and fine print

Regular text <small>small text</small>
Regular text small text
Visual equivalent: Regular text ā‚›ā‚˜ā‚ā‚—ā‚— ā‚œā‚‘ā‚“ā‚œ
Copyright, legal text, disclaimers

Additional Formatting Elements

<ins>Inserted Text

Newly added content

Newly added text
<del>Deleted Text

Removed content

Old removed text
<sub>Subscript

Chemical formulas, footnotes

H2O - Water molecule
<sup>Superscript

Mathematical exponents, footnotes

E = mc2 - Energy formula

Best Practices

āœ“
Use semantic tags for better accessibility
āœ“
Maintain proper heading hierarchy
āœ“
Ensure sufficient color contrast
āœ“
Use relative units for font sizes
āœ“
Limit line length to 50-75 characters
āœ“
Choose readable font families
āœ“
Provide adequate line height
āœ“
Test with screen readers

Accessibility Tips

āœ“ Screen readers announce semantic tags
āœ“ Proper heading structure aids navigation
āœ“ Color alone shouldn't convey meaning
āœ“ Ensure text resizes properly
āœ“ Provide text alternatives for images
āœ“ Maintain keyboard navigation
āœ“ Test with high contrast modes
āœ“ Use ARIA labels when needed

Common Mistakes

āŒ Using <b> instead of <strong>
āœ… Use semantic tags
āŒ Skipping heading levels
āœ… Maintain hierarchy
āŒ Too small font sizes
āœ… Minimum 16px for body
āŒ Poor color contrast
āœ… Test contrast ratios
āŒ Using <br> for spacing
āœ… Use CSS margins
āŒ Nested <div> for text
āœ… Use semantic elements

Readability Statistics

16px
Recommended minimum body text
1.5
Ideal line height ratio
50-75
Optimal characters per line
VIDO - Learn Web Development