Web Structure — full text

6 original lessons · about 175 minutes · self-paced

Course details & full text

Build a meaningful, readable and responsive page from HTML and CSS.

No coding background or paid account required. Use a plain-text editor and a modern browser. Paper works for the first outline exercise; later lessons require saving and opening local HTML files.

Six complete beginner lessons ending with a working local page. Existing introductory review marks remain valid; later lessons require their own review. Further intermediate and advanced pathways remain planned.

  • Use semantic HTML, meaningful links and appropriate image alternatives.
  • Style readable content and build labelled, keyboard-usable practice forms.
  • Create and test a responsive local page without a server or account.

LESSON 1 OF 6 · 25 MINUTES

Give a web page a meaningful outline

STEP 1 OF 6

Your objective

Turn five supplied lines into one page heading, two section headings and two paragraphs, then explain the structure without relying on font size.

STEP 2 OF 6

The idea

HTML marks what text means. In this activity, <h1> identifies the page's main heading, <h2> starts a section under it, and <p> holds an ordinary paragraph. Write a matching closing tag, such as </p>, after each piece of text.

Choose the heading level for its place in the outline, not because you want bigger letters. A visually bold paragraph is still a paragraph; styling does not turn it into a heading.

Meaningful headings help readers scan a page and can help assistive technology navigate it. Correct headings alone do not make an entire website accessible; this lesson covers only a small part of page structure.

No coding software is required. You can write the markup on paper or in your own plain-text notes. This first exercise uses HTML fragments, not a complete document. Later lessons build a local page.

A complete HTML file also needs document structure. Start with <!doctype html>, an html element with lang="en", a head containing <meta charset="utf-8">, a meaningful title and viewport metadata, and a body containing the visible page. Put navigation in nav and the page’s main content in main. A header introduces the page; footer contains closing information. These elements express roles, not a mandatory visual layout.

Create a folder named sketch-practice and a plain-text file named index.html. Check that your editor does not silently append .txt or insert rich-text formatting. Save it, then open it in a browser; after each change, save and reload. A local file can teach structure without hosting or an account. In later lessons you will add an image, styles and a clearly labelled local practice form. The browser shows the page; the editor remains where you change its source.

STEP 3 OF 6

The same announcement, with and without an outline

Starting point

<p>Neighbourhood Sketch Club</p> <p>What to bring</p> <p>Bring paper and a pencil.</p>

A checkable approach

<h1>Neighbourhood Sketch Club</h1> <h2>What to bring</h2> <p>Bring paper and a pencil.</p>

The words did not change. The first version labels every line as a paragraph; the second identifies the announcement title and its first section. A reader inspecting the heading outline can now find the section without using visual size as the only clue.

STEP 4 OF 6

Try it yourself

Build an HTML fragment from these five lines, keeping their order and wording: Community Drawing Afternoon / Materials / Bring plain paper. / Arrival / Meet inside the main entrance. Use one h1, two h2 elements and two p elements. Then choose the explanation below that fits your result. This is a fictional notice, not a real event invitation.

Fictional exercise · prewritten feedback, no live AI grading.

Write your answer on paper or in your own notes, then compare the options and worked answer.

Practice options

A. Make every line h1 so each line is equally noticeable.

That removes the distinction between the overall title, section labels and ordinary information. For this exercise, use the page title once as h1, section labels as h2, and details as paragraphs.

B. Use h1 for the overall title, h2 for Materials and Arrival, and p for their details.

Yes. This follows the supplied outline rather than using headings merely to enlarge text. Check that each opening tag has the intended matching closing tag.

C. Use only paragraphs; bold text always gives screen readers the same heading outline.

Bold appearance does not supply heading semantics. Paragraph-only markup may show the words, but it does not communicate this heading hierarchy.

STEP 5 OF 6

Worked answer & self-check

<h1>Community Drawing Afternoon</h1> <h2>Materials</h2> <p>Bring plain paper.</p> <h2>Arrival</h2> <p>Meet inside the main entrance.</p> The outline has one overall title and two sibling sections. Each instruction is ordinary paragraph text under its section. Option B describes it. These are sensible choices for this simple fragment, not a claim that every possible web page has only this structure.

Compare your answer

  • The five supplied lines remain in the original order, with no invented event details.
  • There is one main heading and two sibling section headings.
  • The two instructions are paragraphs, not headings.
  • Opening and closing tags match, and the explanation refers to meaning rather than visual size.

Give yourself one check for each point your work meets. Revise any missing piece. This is a self-check, not a score sent to a teacher.

STEP 6 OF 6

Recap & next step

  • Structure describes the role of text; appearance is a different concern.
  • In this page outline, h1 names the page and h2 names its sections.
  • Check the outline and the paragraph roles before choosing visual styling.

Next: add meaningful links and images while keeping this outline and the saved first-lesson review mark.

Next lesson: Connect pages and describe images →

LESSON 3 OF 6 · 25 MINUTES

Style for reading and keyboard use

STEP 1 OF 6

Your objective

Apply simple CSS with readable measure, spacing, contrast and visible keyboard focus.

STEP 2 OF 6

The idea

CSS selects elements and assigns presentation properties. In a style element in the document head, body { color: #162536; background: #ffffff; } sets foreground and background colours. A rule contains a selector, braces and property:value declarations separated by semicolons. HTML still carries the meaning; CSS changes how it is shown. If a rule fails, check spelling, punctuation and whether another rule overrides it.

Readable text needs more than a large font. Start with a system font, a line height around 1.6 and a content width limited to about 65 characters. Use relative units such as rem for spacing, so the layout can adapt to text size. Leave space between paragraphs and sections. Avoid a fixed page height or hiding overflow, which can cut off content when a reader zooms or changes text size.

Colour must support reading and interaction. Normal-sized text generally needs at least 4.5:1 contrast for the WCAG AA text-contrast criterion; large text has a different threshold. That one measurement is not whole-page accessibility conformance. The sample uses dark text on white and underlined dark-blue links. Keep links recognisable without relying on colour alone. If you choose a new palette, measure the actual foreground/background pair instead of trusting how it looks on your display.

Keyboard users need to see where focus is. Preserve browser focus outlines or supply a visible replacement with :focus-visible. Use padding on controls for comfortable activation, and let long words wrap rather than forcing the whole page wider. Inspect hover, focus and ordinary states. A page that looks tidy in a screenshot can still hide the selected control or clip text during use.

STEP 3 OF 6

Worked example: style for reading and keyboard use

Starting point

body { width: 1000px; height: 600px; overflow: hidden; } a { color: #cccccc; text-decoration: none; } *:focus { outline: none; }

A checkable approach

body { margin: 0; font: 1rem/1.6 system-ui, sans-serif; color: #162536; background: #fff; } main, header, footer { max-width: 65ch; margin: auto; padding: 1rem; } a { color: #164a80; text-decoration: underline; } :focus-visible { outline: 3px solid #164a80; outline-offset: 3px; }

The revised rules let content grow and keep links and keyboard focus visible. The course’s final example includes these rules in a complete runnable file.

STEP 4 OF 6

Try it yourself

Add the revised CSS to your local page’s head in a style element. Inspect paragraphs, headings and links. Use Tab and Shift+Tab to verify visible focus, then zoom to 200% and check that all content remains reachable. Record one readability improvement and one thing you still need to test; do not describe these checks as a complete accessibility audit.

Fictional exercise · prewritten feedback, no live AI grading.

Write your answer on paper or in your own notes, then compare the options and worked answer.

Practice options

A. Remove focus outlines because the mouse pointer shows the active item.

Keyboard navigation does not use the mouse pointer to show focus. Removing the outline without a visible replacement can make controls difficult to locate.

B. Use dark text, flexible width, spacing and visible focus, then test.

Yes. These are useful foundations, but verify real rendering, zoom and keyboard behaviour. Styling rules alone do not prove complete accessibility.

C. Hide overflow to stop any horizontal scrollbar.

That can conceal the underlying layout problem and make content unreachable. Fix the width or wrapping that causes overflow rather than hiding information.

STEP 5 OF 6

Worked answer & self-check

The revised CSS gives the page a flexible reading width instead of a rigid 1000px width. Text can extend vertically, and the underlined links remain distinguishable from surrounding prose. At 200% zoom, check the whole document and every control; do not merely inspect the heading. Tab should reveal a visible outline on links and controls, and Shift+Tab should move backwards. A valid observation might be “Paragraphs now wrap at a shorter line length; all text remained reachable at 200% in my browser. I still need to check the form after adding it.” Record your actual browser result rather than copying that observation as evidence.

Compare your answer

  • The page retains semantic HTML while CSS handles presentation.
  • Content can grow vertically without clipping.
  • Links are recognisable and keyboard focus is visible.
  • A real zoom and keyboard check is recorded honestly.
  • The learner avoids claiming full conformance from a few checks.

Give yourself one check for each point your work meets. Revise any missing piece. This is a self-check, not a score sent to a teacher.

STEP 6 OF 6

Recap & next step

  • Use flexible reading dimensions.
  • Preserve visible focus and recognisable links.
  • Test styles under interaction and zoom.

Next: build a labelled local practice form.

Next lesson: Build a form that explains itself →

LESSON 4 OF 6 · 25 MINUTES

Build a form that explains itself

STEP 1 OF 6

Your objective

Associate labels and instructions with controls, and distinguish local feedback from a submitted service.

STEP 2 OF 6

The idea

A form is a collection of controls for a task. Each input needs an accessible name, normally a visible label. In <label for="nickname">Fictional nickname</label>, the for value must match the input’s id. A placeholder is not a replacement: it disappears when typing and may not provide a persistent visible instruction. Use ids once per page and keep name attributes for controls whose values you may read or submit.

Choose the right native controls. A select offers a small set of choices; radio buttons can represent mutually exclusive options and should be grouped with fieldset and legend. Use a button for the action. Describe required fields in visible text and use the required attribute when appropriate. Helpful instructions should appear before a problem occurs, and can be associated with a control using aria-describedby.

Our practice form uses a fictional nickname and a material choice to generate a local preparation note. It is not a sign-up or message to an organiser. Native required validation can catch an empty nickname before the submit event; a small script prevents navigation and updates a status paragraph. The script uses textContent so a typed string is treated as text, not inserted as HTML. It performs no fetch or other submission. This limited exercise does not teach server-side processing or security validation.

Feedback should say what happened and what to do next. A status region can announce a generated note without moving focus unexpectedly. An error should identify the problem near its control and give a way to correct it; browser-native messages vary. Test empty and filled inputs, keyboard activation and the actual resulting text. If JavaScript is off, the final example disables its action and shows a clear explanation, so it does not pretend to have processed anything.

STEP 3 OF 6

Worked example: build a form that explains itself

Starting point

<input placeholder="Name"> <div>Send</div> <!-- No associated label, required explanation or real button. -->

A checkable approach

<label for="nickname">Fictional nickname (required)</label> <input id="nickname" name="nickname" required aria-describedby="nickname-help"> <p id="nickname-help">Use an invented name. This is local practice only.</p> <button type="submit">Make practice note</button> <p id="result" role="status"></p>

The markup describes controls; it does not itself send or save anything. Use the complete local example in the final lesson to inspect its small feedback script.

STEP 4 OF 6

Try it yourself

Copy the complete form element, including its labelled nickname input, material select, button and status paragraph, and the accompanying script from the complete final example in Sources into your page. The short demonstration above shows only part of the markup and cannot generate feedback by itself. Save the file and open it in your browser. Test a blank nickname and then “River” with “Paper”. Explain what the form actually does, what it does not do, and why the visible label must remain after typing.

Fictional exercise · prewritten feedback, no live AI grading.

Write your answer on paper or in your own notes, then compare the options and worked answer.

Practice options

A. The form creates a real event registration because it has a submit button.

A button does not establish a registration service. This exercise only updates a local status paragraph; there is no server, account, email or saved registration.

B. A placeholder is enough because users can see it before typing.

Instructions should remain available during use. A visible associated label identifies the field even after the placeholder disappears and supports assistive technology.

C. Associate labels, use native controls and describe the local result honestly.

Correct. Check required-field behaviour and feedback in the actual browser, and keep the practice-only message visible so the result cannot be mistaken for a real submission.

STEP 5 OF 6

Worked answer & self-check

The nickname label’s for="nickname" must match the input id, and the help paragraph must have the id referenced by aria-describedby. A material select also needs its own label. With JavaScript enabled in the final example, an empty required field prevents a normal submit; River with Paper produces “Practice only: River, bring paper. Nothing was sent or saved.” The result is local feedback, not registration. The label remains visible while typing, whereas placeholder text usually disappears. The complete example enables the button only after the handler is installed, and its noscript explanation covers the script-disabled case. Test those behaviours rather than assuming all browsers announce them identically.

Compare your answer

  • Every control has a persistent associated label.
  • Required status and practice-only instructions are visible.
  • A real button and native controls support keyboard use.
  • Empty and filled form results are checked.
  • The explanation distinguishes local feedback from a real submission.

Give yourself one check for each point your work meets. Revise any missing piece. This is a self-check, not a score sent to a teacher.

STEP 6 OF 6

Recap & next step

  • Labels identify controls throughout use.
  • Native semantics provide a strong starting point.
  • Describe only the processing you actually implement.

Next: adapt the whole page to different available widths.

Next lesson: Make the page fit its content and screen →

LESSON 5 OF 6 · 25 MINUTES

Make the page fit its content and screen

STEP 1 OF 6

Your objective

Use flexible dimensions and a content-based breakpoint, then check narrow widths and zoom.

STEP 2 OF 6

The idea

Responsive layout adapts to available space instead of assuming one device size. Include <meta name="viewport" content="width=device-width, initial-scale=1"> in the head so mobile browsers use an appropriate layout viewport. Do not disable zoom. Begin with a single readable column that works on a narrow screen, then add columns only when the content has enough room.

A fluid image needs max-width:100% and height:auto so it scales inside its container while keeping its proportions. Apply box-sizing:border-box to include padding and borders inside declared dimensions. Controls can use width:100% with max-width:100% to fit their column. Long text and flex children may need overflow-wrap:anywhere or min-width:0, but avoid breaking short ordinary words unnecessarily.

A media query applies rules when a condition matches. For this exercise, .layout is a grid with one column by default; @media (min-width:48rem) changes it to two equal columns. The breakpoint is a design choice for this content, not proof that every tablet or phone has that size. If your paragraphs or controls feel cramped before 48rem, adjust based on what fails and retest the intermediate widths.

Test behaviour as well as appearance: 320px and 390px narrow widths, a wider desktop view, portrait and landscape if available, and browser zoom. Follow every link and operate the form with the keyboard. Look for page-level horizontal scrolling, clipped focus outlines, overlapping text and images covering controls. Device emulation is useful evidence but is not a physical-phone or screen-reader test. Record the conditions actually checked and any remaining limits.

STEP 3 OF 6

Worked example: make the page fit its content and screen

Starting point

.layout { display: grid; grid-template-columns: 600px 600px; } img { width: 800px; height: 400px; }

A checkable approach

* { box-sizing: border-box; } .layout { display: grid; gap: 1rem; } .layout > * { min-width: 0; } img { max-width: 100%; height: auto; } input, select, button { max-width: 100%; } @media (min-width: 48rem) { .layout { grid-template-columns: 1fr 1fr; } }

The default single column fits narrow spaces. At the chosen wider breakpoint, the two sections can sit side by side without a fixed pixel width.

STEP 4 OF 6

Try it yourself

Put Materials and the practice form inside a .layout container, then apply the responsive rules. Test at 320px, 390px and a desktop width, plus 200% zoom where available. Record the smallest width tested, whether the entire page scrolls horizontally, and whether the form and anchor remain usable. Revise one width rule if needed and repeat the failed check.

Fictional exercise · prewritten feedback, no live AI grading.

Write your answer on paper or in your own notes, then compare the options and worked answer.

Practice options

A. Choose one fixed width that matches your own phone.

A single fixed width can fail on another screen or with enlarged text. Use available space and content requirements, then test several conditions.

B. Hide everything that overflows.

That can remove necessary information or controls. Identify the element causing overflow and fix its dimensions, wrapping or layout instead of concealing it.

C. Start with one column and add columns only when content fits.

Yes. The media query is an enhancement to a usable narrow layout. Verify intermediate sizes and zoom because a pair of endpoint screenshots can miss failures.

STEP 5 OF 6

Worked answer & self-check

The container should use a single-column grid below 48rem and two equal flexible columns at or above it. Images keep their aspect ratio, and controls remain inside their columns. At 320px, the page should not require sideways document scrolling to read instructions or use the form. At 200% zoom, it may return to one column; that is appropriate if it preserves access to content. A valid report names actual widths, browser, zoom and the observed result. If a long token causes overflow, constrain the relevant element and add wrapping where appropriate, then retest. Do not claim physical-device or assistive-technology coverage from a resized desktop browser.

Compare your answer

  • Viewport metadata allows normal mobile layout and zoom.
  • The narrow default layout works without fixed wide columns.
  • Images and form controls fit their containers.
  • Several widths and zoom are checked with recorded results.
  • Any fix is retested and evidence limits are named.

Give yourself one check for each point your work meets. Revise any missing piece. This is a self-check, not a score sent to a teacher.

STEP 6 OF 6

Recap & next step

  • Design from available space and content.
  • Use fluid dimensions before breakpoints.
  • A responsive claim needs actual width checks.

Next: assemble, test and revise your finished local page.

Next lesson: Project: build and verify a small page →

LESSON 6 OF 6 · 50 MINUTES

Project: build and verify a small page

STEP 1 OF 6

Your objective

Deliver a working local page, its image and a concise check log covering content, links, forms and responsive reading.

STEP 2 OF 6

The idea

Your final deliverable is a small folder that another learner can open locally. It contains index.html and an original or permission-cleared image. Build from the heading exercise and combine the skills you have practised: semantic regions, meaningful links, a useful image alternative, readable CSS, a labelled practice form and a flexible layout. A mockup or screenshot alone cannot demonstrate the link and form behaviour.

The complete worked answer below is also available as a runnable page and a plain-text source file in Sources. Save its source as index.html and the supplied pencils.svg beside it. The tiny script is supplied to make the form’s local feedback work; understanding every JavaScript construct is outside this HTML/CSS beginner course. You should still be able to explain that it stops navigation, reads two controls and writes text without sending or saving it.

Review the page against a concrete checklist. Open it from disk, navigate its section links, check the image and the heading sequence, operate the form with mouse and keyboard, try a blank nickname and a filled one, and inspect the result. Resize and zoom as described in lesson five. Confirm that the visible fictional/practice-only statements accurately describe the page. Record failures and corrections, not just a final claim that it works.

Then make one meaningful revision: add “Eraser” to both the materials list and the select options, using value="eraser". Check that the existing script now reports the new choice correctly without special-case code. Recheck narrow layout and keyboard use. Completion is your own documented review, not an automated grade, public publication or evidence of full accessibility conformance.

STEP 3 OF 6

Worked example: project: build and verify a small page

Starting point

A page picture shows a title and a form, but there is no runnable HTML, no image file and no interaction evidence.

A checkable approach

Folder: index.html + pencils.svg. Check log: headings; section links; image/alt; empty/filled form; keyboard focus; 320px/390px/desktop; zoom; no network submission. Revision: add Eraser to the list and select, then retest the generated note.

Use the full worked answer as a comparison after attempting your own page. Different valid markup and styles are welcome when they satisfy the same behaviours.

STEP 4 OF 6

Try it yourself

Build the complete local page and keep both its HTML source and image. Test every item in the worked checklist and record actual results, including anything you could not test. Then revise the page by adding Eraser to both the materials list and select. Enter River, select Eraser, activate the button and verify the new text. Explain two structural or accessibility choices and one limitation. Keep the result local; no hosting or account is needed.

Fictional exercise · prewritten feedback, no live AI grading.

Write your answer on paper or in your own notes, then compare the options and worked answer.

Practice options

A. A screenshot alone proves the form works.

A screenshot shows one visual state. A runnable page and observed empty/filled/keyboard tests are needed to demonstrate how the control behaves.

B. Add Eraser in both places and retest the existing local-feedback path.

Yes. The list and choice control should agree. The current script reads the selected value, so the new option should work without a separate branch or remote request.

C. Claim complete accessibility because the page has labels.

Labels are one necessary part of many forms. This course’s bounded checks do not establish full accessibility or screen-reader compatibility across environments.

STEP 5 OF 6

Worked answer & self-check

Complete reference index.html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Community Drawing Afternoon — practice</title> <style> * { box-sizing: border-box; } body { margin: 0; font: 1rem/1.6 system-ui, sans-serif; color: #162536; background: #fff; } header, main, footer { max-width: 65ch; margin: auto; padding: 1rem; } h1, h2 { line-height: 1.2; } a { color: #164a80; text-decoration: underline; } :focus-visible { outline: 3px solid #164a80; outline-offset: 3px; } img { max-width: 100%; height: auto; } .layout { display: grid; gap: 1.5rem; } .layout > * { min-width: 0; } label { display: block; margin-top: 1rem; } input, select, button { font: inherit; padding: .6rem; max-width: 100%; } input, select { width: 100%; } button { margin-top: 1rem; color: #fff; background: #164a80; border: 2px solid #164a80; } button:disabled { color: #333; background: #eee; border-color: #666; } #result { overflow-wrap: anywhere; } @media (min-width: 48rem) { .layout { grid-template-columns: 1fr 1fr; } } </style> </head> <body> <a href="#main">Skip to content</a> <header> <h1>Community Drawing Afternoon</h1> <p>Fictional learning exercise — not an event invitation.</p> <nav aria-label="On this page"><a href="#materials">Materials</a> · <a href="#practice">Practice note</a></nav> </header> <main id="main"> <p>Practise planning a drawing session. No date, venue or registration is offered.</p> <img src="pencils.svg" width="320" height="160" alt="Two pencils beside a blank sheet"> <div class="layout"> <section aria-labelledby="materials"> <h2 id="materials">Materials</h2> <p>Choose one material for a local practice note.</p> <ul><li>Pencil</li><li>Paper</li></ul> </section> <section aria-labelledby="practice"> <h2 id="practice">Make a practice note</h2> <p>This form only changes text on this page. It sends and saves nothing.</p> <form id="practice-form"> <label for="nickname">Fictional nickname (required)</label> <input id="nickname" name="nickname" required maxlength="40" aria-describedby="nickname-help"> <p id="nickname-help">Use an invented name, such as River.</p> <label for="material">Material</label> <select id="material" name="material"><option value="pencil">Pencil</option><option value="paper">Paper</option></select> <button id="make-note" type="submit" disabled>Make practice note</button> </form> <p id="result" role="status"></p> <noscript><p>JavaScript is off. The practice action is unavailable; all instructions remain readable.</p></noscript> </section> </div> </main> <footer><p>Original local HTML/CSS exercise. Self-check your result; no live grading.</p></footer> <script> const form = document.getElementById('practice-form'); form.addEventListener('submit', function (event) { event.preventDefault(); const nickname = document.getElementById('nickname').value.trim(); const material = document.getElementById('material').value; document.getElementById('result').textContent = nickname ? 'Practice only: ' + nickname + ', bring ' + material + '. Nothing was sent or saved.' : 'Enter a fictional nickname to make a practice note.'; }); document.getElementById('make-note').disabled = false; </script> </body> </html> Revision answer: add <li>Eraser</li> to the list and <option value="eraser">Eraser</option> to the select. With River entered, the result should be “Practice only: River, bring eraser. Nothing was sent or saved.” The label/id associations give controls names; the flexible grid preserves a one-column narrow view. Keep your real test log separate from this model answer. Source and image links below let you save the same original example without retyping.

Compare your answer

  • The folder includes a runnable HTML file and a working cleared image.
  • Semantic regions, headings, links and image alternatives match their purposes.
  • Form labels, required behaviour, keyboard focus and local feedback are checked.
  • Narrow, wide and zoom checks record actual conditions and limits.
  • The Eraser revision updates both list and control and produces the expected note.
  • No real service, live grading or full accessibility claim is implied.

Give yourself one check for each point your work meets. Revise any missing piece. This is a self-check, not a score sent to a teacher.

STEP 6 OF 6

Recap & next step

  • Deliver runnable work with supporting files.
  • Test interactions as well as appearance.
  • Revise and retest the affected behaviour.

You have finished the six-lesson Web Structure short course. Review any unmet criteria, then practise a second small page. Intermediate and advanced web pathways remain planned.

Revisit the course → · Choose another course →

Sources & learning limits

Examples, exercises and worked answers are original fictional teaching material. Source checks inform the factual explanations; these organisations do not endorse this course.

This independent course is general education, not accreditation, a degree, professional advice or a promise of competence. No institutional affiliation or endorsement is implied. The illustrated setting is fictional.