{ "$schema": "../schemas/code-crispies-module-schema.json", "id": "html-elements", "title": "HTML Elements: Block vs Inline", "description": "Understanding the fundamental difference between container (block) and inline elements", "mode": "html", "difficulty": "beginner", "lessons": [ { "id": "block-vs-inline-intro", "title": "Block vs Inline Elements", "description": "HTML elements fall into two main categories:

Block elements (containers) start on a new line and take full width. Examples: <div>, <p>, <h1>, <section>

Inline elements flow within text and only take needed width. Examples: <span>, <a>, <strong>, <em>", "task": "Wrap the word important with <strong> tags to make it bold. Notice how the paragraph (block) takes full width while strong (inline) flows with text.", "previewHTML": "", "previewBaseCSS": "body { font-family: system-ui, sans-serif; padding: 20px; } p { background: #e3f2fd; padding: 10px; } strong { background: #ffecb3; }", "sandboxCSS": "", "initialCode": "

This is a paragraph with an important word.

", "solution": "

This is a paragraph with an important word.

", "previewContainer": "preview-area", "validations": [ { "type": "element_exists", "value": "p", "message": "Add a

paragraph element" }, { "type": "parent_child", "value": { "parent": "p", "child": "strong" }, "message": "Wrap the word 'important' with tags" } ] }, { "id": "semantic-containers", "title": "Semantic Container Elements", "description": "Modern HTML uses semantic containers that describe their content:

<header> - Page or section header
<nav> - Navigation links
<main> - Main content area
<section> - Thematic grouping
<article> - Self-contained content
<footer> - Page or section footer", "task": "Create a basic page structure:
1. Add a <header> with an <h1> containing the text 'My Website'
2. Add a <main> element with a paragraph saying 'Welcome to my site!'
3. Add a <footer> with a paragraph saying 'Copyright 2025'", "previewHTML": "", "previewBaseCSS": "body { font-family: system-ui; margin: 0; } header { background: #1976d2; color: white; padding: 15px; } main { padding: 20px; min-height: 100px; } footer { background: #424242; color: white; padding: 10px; text-align: center; }", "sandboxCSS": "", "initialCode": "", "solution": "

\n

My Website

\n
\n
\n

Welcome to my site!

\n
\n", "previewContainer": "preview-area", "validations": [ { "type": "element_exists", "value": "header", "message": "Add a
element" }, { "type": "element_exists", "value": "main", "message": "Add a
element" }, { "type": "element_exists", "value": "footer", "message": "Add a