ACM LEARNING

Web foundations: HTML, CSS and JavaScript

Build a small accessible page and make it interactive.

Open coding playground Developer tools

Complete each lesson, attempt the exercise and compare with the worked answer.

Semantic HTML

Use a main element for the primary content, a heading for the topic, a label for every form control and a button for an action. Structure matters before styling. A link navigates; a button performs an action. The accessible name of an input can come from its associated label.

Practice

Create a form with a label associated with a text input and a submit button.

Review answer

<label for="name">Name</label><input id="name" name="name"><button type="submit">Send</button>

Sign in to sync progress

Responsive CSS

Use flexible containers, relative widths and media queries. A responsive grid can use repeat(auto-fit,minmax(180px,1fr)) with a gap. Check narrow screens and ensure labels and buttons do not overflow.

Practice

Build a three-card grid that wraps on narrow screens.

Review answer

display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;

Sign in to sync progress

DOM events

Use addEventListener to attach event handlers. Prefer textContent to insert text safely instead of innerHTML. Keep state and display separate so you can update the interface predictably.

Practice

Add a button that increments a counter.

Review answer

let n=0; button.addEventListener("click",()=>{ count.textContent=++n; });

Sign in to sync progress

All courses

How can we help?

Support centreProject enquiry

Project visual

Open original image ↗

ACM Assistant

Ask about our software, apps, services or support.

Automated assistance. Do not enter passwords, payment details or confidential information. AI mode may send your question to an external provider.

Contact our team

Tell us about your project