Text is one of the most important parts of any webpage. HTML provides different tags to organize and style text properly.
1. Headings (<h1> to <h6>)
Define titles and subtitles.
<h1> is the most important heading (main title).
<h6> is the least important (smallest subtitle).
Example:
2. Paragraphs (<p>)
Used for blocks of text.
Browsers automatically add spacing before and after paragraphs.
Example:
3. Text Formatting
HTML has inline tags to emphasize or style text:
<b> → Bold text
<i> → Italic text
<u> → Underlined text
<strong> → Important text (semantic bold)
<em> → Emphasized text (semantic italic)
<mark> → Highlighted text
<small> → Smaller text
<sup> / <sub> → Superscript / Subscript
Example:
Summary
Headings (<h1>–<h6>) organize content into titles and sections.
Paragraphs (<p>) group text into readable blocks.
Text formatting tags (like <b>, <i>, <u>, <strong>, <em>) add emphasis and style.