Chapters & contents Lesson 20 of 20
3 min read
Web development foundationsExpanded reading

Build a lesson page that works before it animates

Use document structure, real controls, and clear request behavior as the foundation.

What you’ll learn

  • Choose semantic elements for reading and navigation
  • Trace a search request and response
  • Check keyboard access and persistent control labels

Begin with a readable document

A learner should be able to identify the lesson title, move through its sections, and find the next relevant topic without decoding visual decoration. Use a logical heading hierarchy, a main region for the lesson, and navigation regions with meaningful labels where needed. A heading is a structural promise rather than a way to obtain a large font. The same structure helps readers scanning the page, people using assistive technology, and contributors editing the content later. Start with the document before adding motion.

Use controls that carry their purpose

A link moves to another resource, while a button performs an action such as checking an answer or opening a dialog. A search field needs an accessible name that identifies its purpose even after the learner types and its placeholder disappears. Associate a label with the input using matching for and id values. A visible label often helps everyone, though a carefully implemented visually hidden label can fit a minimal design. Do not replace native controls with clickable generic containers unless there is a justified need and complete interaction support.

html · Worked example
<form action="/search" method="get">
  <label for="lesson-search">Search lessons</label>
  <input id="lesson-search" name="q" type="search">
  <button type="submit">Search</button>
</form>

Trace a search through HTTP

A simple search form can submit a GET request with a query parameter, for example /search?q=python. The server or static application interprets the request and returns or displays an appropriate representation. A successful HTTP status alone does not prove the search result is useful, so show a clear empty state when no lesson matches. Preserve the query in a shareable URL when that matches the product design. HTTP methods carry semantics; avoid using a supposedly safe retrieval request to change a learner’s account data.

Make enhanced navigation preserve orientation

If JavaScript transforms the landing search into a lesson panel, the learner still needs a stable URL, a useful browser Back action, and a sensible focus destination. Update the document title and move focus intentionally when a genuinely new view opens. Do not let a decorative animation leave invisible interactive controls in the tab order. Provide a reduced-motion path and avoid delaying access to reading material solely for a repeated animation. A smooth transition should make the location clearer, rather than hiding what changed.

Check a small task from beginning to end

Test opening a lesson directly, searching with only the keyboard, submitting an unmatched query, moving through headings, following a topic link, and returning with the browser Back button. Check a narrow screen and a zoomed layout for clipped text or trapped scrolling. Automated accessibility checks can detect some issues, but manually completing these tasks reveals problems they miss. A focused learning interface earns its polish by remaining understandable under ordinary constraints, including a slow connection and a person who prefers very little motion.

Try it yourself

A search field has only a disappearing placeholder and a clickable div labeled Go. Describe two semantic repairs and one focus behavior to verify when results open without a full reload.

Show a possible solution

Give the input a persistent accessible label and use a real submit button within a form. When a new results view appears, verify that focus moves to an appropriate results heading or announced status without trapping the keyboard, while Back restores useful navigation context.

Check your understanding

Try 14 questions across web development foundations. Read each explanation and revisit anything that needs another pass.

Practise this subject

Go to the source

Use these primary references to check details and explore the topic further.

Saved in this browser. Signed-in progress syncs to your account.