HTML MCQ Test
20 random HTML multiple-choice questions with answers and explanations: elements, attributes, links, images, lists, tables, forms and semantic HTML. Free, timed, instant score.
- 20 random questions
- 20 minutes
- 60 in the question bank
No sign-up needed. Answers and explanations are shown at the end.
About this test
HTML questions come up in almost every web-development interview and college exam, usually as quick one-liners: which tag, which attribute, which input type. This test checks exactly those details.
It mixes basics (page structure, headings, links) with the parts people forget under pressure: form inputs, table tags, semantic elements and accessibility.
Each attempt picks new questions at random from the question bank. You can go back and change answers until you finish or the timer runs out. At the end you see your score, the right answer and a short explanation for every question, and the lessons to revise for the ones you missed.
Topics covered
- HTML Introduction
- HTML Editors
- HTML Basic Structure
- HTML Elements
- HTML Attributes
- HTML Headings
- HTML Paragraphs
- HTML Text Formatting
- HTML Links
- HTML Images
- HTML Lists
- HTML Tables
- HTML Div and Span
- HTML Classes and IDs
- HTML Forms
- HTML Form Inputs
- HTML Semantic Elements
- HTML Media (Audio and Video)
- HTML Accessibility Basics
- HTML Project: Build a Personal Profile Page
Sample questions with answers
1. What does HTML stand for?
- High Tech Modern Language
- Hyperlink and Text Management Logic
- HyperText Markup Language
Show answer
C. HyperText Markup Language — HTML is a markup language: it labels the parts of a page (headings, paragraphs, links) so the browser knows what each part is.
2. Which editor does the lesson recommend for writing HTML?
- Microsoft Word
- Visual Studio Code
- Paint
Show answer
B. Visual Studio Code — VS Code is free, with highlighting, auto-complete and extensions.
3. What goes inside <head>?
- Only images
- All visible content
- Information about the page, like the title and character set
Show answer
C. Information about the page, like the title and character set — Visible content goes in <body>.
4. Which is an empty (void) element?
<p><br><h1>
Show answer
B. <br> — Empty elements have no content and no closing tag.
5. Which attribute gives an image its alternative text?
- title
- alt
- src
Show answer
B. alt — alt is read by screen readers and shown if the image fails.
6. How many levels of headings does HTML have?
- 6
- 3
- 10
Show answer
A. 6 — h1 to h6.
7. What happens to extra spaces and line breaks in HTML source?
- The browser collapses them into one space
- They're shown exactly
- They cause errors
Show answer
A. The browser collapses them into one space — Use <pre> to keep spacing.
8. What's the difference between <strong> and <b>?
- No difference
- b is newer
- strong adds importance (meaning); b is only visual
Show answer
C. strong adds importance (meaning); b is only visual — Screen readers can convey strong importance.
9. Which link opens in a new tab safely?
<a href="…" tab="new"><a href="…" target="_blank" rel="noopener"><a href="…" new>
Show answer
B. <a href="…" target="_blank" rel="noopener"> — target="_blank" opens a new tab.
10. Why set width and height on images?
- To make images sharper
- It's required for alt text
- The browser reserves space so the page doesn't jump while loading
Show answer
C. The browser reserves space so the page doesn't jump while loading — It improves layout stability.