diff --git a/lessons/20-html-elements.json b/lessons/20-html-elements.json index 013da18..6522a93 100644 --- a/lessons/20-html-elements.json +++ b/lessons/20-html-elements.json @@ -17,6 +17,10 @@ "initialCode": "

This is a paragraph with an important word.

", "solution": "

This is a paragraph with an important word.

", "previewContainer": "preview-area", + "concept": { + "explanation": "The browser's layout engine treats block and inline elements fundamentally differently. Block elements create a rectangular box that starts on a new line and expands to fill available width, stacking vertically like building blocks. Inline elements flow horizontally within text content, wrapping to new lines only when they run out of space—like words in a paragraph. This distinction controls document flow: use block for structure (sections, paragraphs) and inline for content emphasis (bold, links) without breaking the text flow.", + "diagram": "Block vs Inline Layout\n\nBlock elements (vertical stacking):\n┌─────────────────────────────┐\n│
Full width block │ ← New line\n└─────────────────────────────┘\n┌─────────────────────────────┐\n│

Another block element │ ← New line\n└─────────────────────────────┘\n\nInline elements (horizontal flow):\n┌─────────────────────────────┐\n│ Text with link and │\n│ bold flows │ ← Wraps naturally\n│ like words in a sentence. │\n└─────────────────────────────┘\n\nKey differences:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nBlock: New line, full width\nInline: Same line, auto width\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + }, "validations": [ { "type": "element_exists", @@ -41,6 +45,10 @@ "initialCode": "", "solution": "

\n

My Website

\n
\n
\n

Welcome to my site!

\n
\n", "previewContainer": "preview-area", + "concept": { + "explanation": "Semantic HTML elements convey meaning about their content, not just appearance. Screen readers use semantic tags to help blind users navigate (\"skip to main content\" relies on
), search engines rank pages higher when structure is clear (
signals important content), and developers understand code faster when tags describe purpose. Using
instead of
gives the same visual result but adds machine-readable meaning that assistive technology and search crawlers can understand. This is the foundation of accessible, SEO-friendly web development.", + "diagram": "Semantic Page Structure\n\n┌─────────────────────────────┐\n│
│ ← Page header\n│

Site Title

│ (branding, logo)\n│ │ (navigation)\n└─────────────────────────────┘\n┌─────────────────────────────┐\n│
│ ← Primary content\n│
Blog Post
(unique per page)\n│
Comments
(landmarks)\n└─────────────────────────────┘\n┌─────────────────────────────┐\n│