HTML Quiz
Thirty questions covering the whole course. Choose an answer for each, then press Check answers at the bottom to see your score and an explanation for every question.
1. What does HTML describe?
CSS handles appearance; JavaScript handles behaviour (lesson 01).
2. What must be the very first line of an HTML document?
Without it, browsers use quirks mode (lesson 03).
3. Where does the <title> element go?
The title is metadata (lesson 03).
4. Which of these is a void element (no closing tag)?
Void elements include img, br, hr, input, meta and link (lesson 04).
5. How do you turn a boolean attribute like disabled off?
Any presence of the attribute means true (lesson 05).
6. How many <h1> elements should a page normally have?
One main heading describing the page (lesson 06).
7. Which element conveys strong importance?
<b> is bold without extra importance (lesson 07).
8. How do you display a literal < character in text?
Use the character entity (lesson 09).
9. What is the best link text for a PDF report?
Link text should describe the destination (lesson 10).
10. Which link opens the user's email app?
mailto: URLs open the email client (lesson 10).
11. What alt text should a purely decorative image have?
An empty alt tells screen readers to skip it (lesson 12).
12. Why set width and height on images?
It prevents layout shift (lessons 12 and 45).
13. Which element lets you serve a different image crop on small screens?
Use <picture> with media conditions (lesson 13).
14. What does the <track> element add to a video?
Tracks point to WebVTT caption files (lesson 16).
15. What does the sandbox attribute do on an iframe?
Permissions are added back with allow-* tokens (lesson 17).
16. Which element can be a direct child of <ul>?
Nested lists go inside an <li> (lesson 18).
17. What does scope="col" on a <th> mean?
Scope tells assistive technology which cells a header describes (lesson 19).
18. What should tables be used for?
Use CSS Grid and Flexbox for layout (lesson 19).
19. What's the difference between a class and an id?
(lesson 23).
20. Which element represents the page's primary content?
Only one visible main per page (lesson 24).
21. Why connect a <label> to an input?
Labels are essential for accessible forms (lesson 29).
22. What is the default type of a button inside a form?
Always set type="button" for non-submitting buttons (lesson 31).
23. Which input type gives a numeric keypad AND checks min/max values?
For codes and card numbers, prefer text + inputmode instead (lesson 27).
24. Are disabled form fields submitted?
Readonly fields are submitted; disabled ones aren't (lessons 28 and 33).
25. Which method should a login form use?
GET would put the password in the URL (lesson 33).
26. Why is client-side validation not enough on its own?
Browser validation is for user experience, not security (lesson 32).
27. What does the defer attribute do on a script?
The recommended default for scripts (lesson 37).
28. Which opens a modal dialog with the page behind it made inert?
(lesson 38).
29. What is the first rule of ARIA?
Native elements bring semantics and keyboard behaviour for free (lesson 44).
30. What does loading="lazy" do on an image?
Don't lazy-load the main image at the top of the page (lesson 45).
Missed a few? Each explanation names the lesson to revisit. Then try the exercises.