Headings and Paragraphs
Headings and paragraphs give your content visual hierarchy and structural meaning, making pages easy to scan and read.
What is it?
HTML provides six levels of section headings from `<h1>` (highest priority) down to `<h6>` (lowest priority), alongside `<p>` for standard paragraphs.
Why is it used?
Users scan web pages quickly rather than reading every word. Proper heading hierarchies improve readability and allow screen readers and search engines to understand the document outline.
Detailed Explanation
Syntax Structure
<h1>Main Document Heading</h1>
<h2>Major Section Heading</h2>
<p>Body copy paragraph text.</p>
Code Example
<h1>Mastering Full-Stack Web Development</h1>
<p>Welcome to the comprehensive roadmap designed for aspiring engineers.</p>
<h2>Frontend Technologies</h2>
<p>Frontend developers craft user interfaces using HTML, CSS, and modern JavaScript.</p>
<h3>HTML5 Foundations</h3>
<p>Learn semantic elements, accessible forms, and responsive media handling.</p>
<h3>CSS3 Styling</h3>
<p>Bring pages to life with Flexbox, CSS Grid, and fluid responsive animations.</p>
Explanation of the Code
Expected Output
Real-World Application
Google Search explicitly evaluates `<h1>` and `<h2>` elements to index web pages for search queries.
Common Mistakes to Avoid
Quick Practice Challenge
Create a blog post outline with an H1 title, two H2 sub-sections, each having one paragraph and one H3 sub-topic.