HTML Beginner

HTML Text Elements: Headings, Paragraphs, and Formatting

CodingerWeb
CodingerWeb
29 views 20 min read

HTML Text Elements

HTML provides various elements for structuring and formatting text content on web pages.

Headings (h1-h6)

<h1>Main Heading</h1>
<h2>Section Heading</h2>
<h3>Subsection Heading</h3>
<h4>Minor Heading</h4>
<h5>Small Heading</h5>
<h6>Smallest Heading</h6>

Paragraphs and Line Breaks

<p>This is a paragraph of text.</p>
<p>This is another paragraph.</p>
<br> <!-- Line break -->
<hr> <!-- Horizontal rule -->

Text Formatting

<strong>Bold text</strong>
<em>Italic text</em>
<u>Underlined text</u>
<mark>Highlighted text</mark>
<small>Small text</small>
<del>Deleted text</del>
<ins>Inserted text</ins>

Best Practices

  • Use headings hierarchically (h1 → h2 → h3)
  • Use <strong> and <em> for semantic meaning
  • Keep paragraphs concise and focused