Bhylu

HTML Quiz

Use these questions to explain concepts in your own words. Think through an answer before opening each explanation; this is a self-check, not a graded certification exam.

How it works

  • A correct answer should explain the consequence, not only name a tag. For example, say how a missing name changes a form submission.
  • When you are unsure, build a small example and inspect the actual DOM, request, or keyboard behaviour.
  • Revisit the related chapter after a mistake. Understanding a reason is more durable than memorising a single code sample.

Practice checkpoints

1. Which element supplies the browser-tab title?

title inside head supplies the document title. An h1 introduces visible content and does not replace title.

2. Does display: block turn a span into a semantic section?

No. CSS display changes layout boxes, not the element’s HTML meaning or content model.

3. When should an image have alt=""?

When the image is genuinely decorative or redundant and adds no information that needs a text alternative in this context.

4. Why use th scope="col" in a data table?

It identifies a column heading and makes the intended relationship clearer than a bold data cell.

5. Does a hidden input protect its value from modification?

No. A visitor can alter the request. Validate and authorise the value on the server.

6. Why can a CSS background not replace the only written event date?

It has no alt text and may be missing, cropped, or unavailable to readers. Essential information belongs in real content.

7. Can a Web Worker directly update document.body?

No. A worker has no DOM. It sends a message to page-side code, which can update the document.

8. Is a popover automatically a modal dialog?

No. A popover is non-modal by itself. Use the appropriate dialog interaction when the rest of the page must be unavailable.

A practical example

HTML

<label for="visitor-email">Email address</label>
<input id="visitor-email" type="email">

The label relationship is present, but the input has no name. Its value will not be included as a named form field in an ordinary submission.