Academics · Middle School · Grades 6–8
Ten lessons, each one idea and one task: tags, headings, lists, links and pictures, then CSS rules, classes, the box model, readable text, flexbox and small screens. Then build a page of your own and download it.
Read the idea, do the task in the editor and watch the checks. Stuck: read the problems under the editor, or show a solution. Load the example to see a finished page.
Loading the playground. If nothing appears, turn on JavaScript.
Your page appears here as you type.
The preview runs these three steps every time you stop typing. The checks read the result of step 3, the same page you see.
The browser reads the tags from top to bottom and builds a tree of elements. A tag inside another tag becomes its child. A tag left open swallows what follows it, which is why the problem finder cares.
Each rule’s selector is matched against the tree. When two rules set the same property on one element, the more specific selector wins, and between equals the later rule wins.
The browser works out each box’s size from its content, padding, border and margin, stacks or lines the boxes up, and paints them. Change one number and the whole page is laid out again.
Academics · Middle SchoolFree
What gets checked, what the problem finder looks for, and why the preview cannot reach the internet.
<html>, <head> with your CSS in a <style> tag, and <body>). Download the page to see all of it.Each lesson is five to ten minutes: read the idea, do the task, watch the checks. The ten lessons fit two or three class periods; the project can fill as many more as a student wants to give it.
Show a solution is there on purpose. A student who is stuck learns more from reading a working answer line by line, then starting the step again, than from guessing.
The downloaded file is an ordinary web page. Open it in any browser, or in a text editor to keep working on it without this playground. Nothing here needs an account, and no names are asked for.
| Step | Idea | The task | Checks |
|---|---|---|---|
| 1 | Tags wrap content | Add a paragraph under the heading: type <p>, a sentence about Saturn, then </p>. | 3 |
| 2 | Headings make an outline | Put an <h2> heading above each paragraph: one about the rings, one about the moons. | 3 |
| 3 | Lists | Turn the three facts into a bulleted list: one <ul> holding three <li> items. | 3 |
| 4 | Links and pictures | Add the picture planet.svg with alt text. Then make the words NASA’s Saturn page a link to https://science.nasa.gov/saturn/. | 4 |
| 5 | Your first CSS rule | In the CSS tab, write a rule for h1 that changes its color and makes its font-size at least 40px. | 3 |
| 6 | Classes | Give the second paragraph the class note. Then give .note a background-color and at least 8px of padding. | 4 |
| 7 | The box model | Give .card a border, at least 16px of padding, a border-radius, and at least 20px of margin-bottom. | 4 |
| 8 | Text people can read | Set a font-family on body, give p a line-height of at least 1.5, and darken the paragraph color until the contrast check passes. | 3 |
| 9 | Side by side with flexbox | Make .row a flex container with a gap of at least 12px, so the three cards sit side by side. | 3 |
| 10 | Fit small screens | Give main a max-width of 600px or less and center it with auto margins. Then add a media query that makes h1 smaller on screens up to 600px wide. Use the Phone button above the preview to test it. | 3 |
| Project | Your own page | Write the HTML and the CSS for a page of your own, then download it. Load the example to see one finished page about Saturn. | 9 |
A first course in writing a page by hand. It does not cover JavaScript, forms or publishing a site. The three built-in pictures are original to Caveat; in the preview, pictures and links from other sites are switched off. Support: team@caveatacademic.com.