HTML · Practice tests · Updated November 2026
An HTML practice test checks how well you know the markup behind every web page: document structure, links, images and media, tables, forms, semantic elements, accessibility, SEO metadata and modern elements such as dialog, popover and details. There is no numbered HTML version to learn any more: the WHATWG maintains HTML as the HTML Living Standard and updates it continuously. Good questions are therefore checked against the current standard and MDN, not against old tutorials that still teach cellpadding or the keywords meta tag. This guide covers what a good HTML practice test includes, who it suits and a 2–3 week plan, and ends with 10 free HTML practice questions with answers.
At a glance
| Topic | HTML markup for web pages |
| Official standard | HTML Living Standard (WHATWG) |
| Versioning | Updated continuously, not frozen |
| Official HTML certification | Not published |
| Accessibility standard | WCAG 2.2 (W3C Recommendation) |
| Exametics set | 7 practice tests, 280 questions |
- Good HTML questions show a short snippet and ask what the browser does with it.
- Learn from the living standard and MDN. Many old HTML habits are now obsolete.
- Want to test yourself now? Jump to the 10 free HTML practice questions.
Source: HTML Living Standard: introduction and Web Content Accessibility Guidelines (WCAG) 2.2. Checked on 9 November 2026.
What a good HTML practice test covers
A good HTML practice test covers the markup you write every day and checks it against the current standard: how a document is built, how links, media, tables and forms behave, and how semantic, accessible markup helps people and search engines.
It should also follow the current standard. The HTML Living Standard is updated continuously rather than frozen as “HTML5”, so a question written for an older snapshot can now have a wrong answer. The five topic groups below are the same ones the free practice questions at the end of this post are drawn from.
Document structure, metadata and scripts
The first group checks that you can build a valid page from the top down. The HTML standard’s introduction says the DOCTYPE is required to trigger no-quirks mode, and its sample page starts with <!DOCTYPE html>.
Metadata questions test small rules that are easy to forget. The MDN reference for the meta element says a character-encoding declaration must sit entirely within the first 1024 bytes of the document, and that UTF-8 is the only valid encoding. So <meta charset="utf-8"> belongs near the top of head.
Script loading is the other common trap. The MDN reference for the script element explains the differences:
defer: the script runs after the document is parsed, beforeDOMContentLoaded, in the order the scripts appear.async: the script runs as soon as it has downloaded, with no guarantee of order.- Inline scripts and modules:
deferhas no effect on an inline script, andtype="module"scripts are deferred by default.
Links, media and tables
Link questions go beyond href. The MDN reference for the a element says that in newer browsers target="_blank" gives the same protection as rel="noopener", that the download attribute only works for same-origin, blob: and data: URLs, and that link text should say where the link goes. “Click here” is the classic mistake.
Media questions centre on the img element. According to the MDN reference for the img element, alt="" marks a decorative image, width and height let the browser reserve space before the image loads, and loading="lazy" defers loading until the image is near the viewport. If you leave out sizes, it defaults to 100vw.
Table questions test meaning, not looks. The tables section of the HTML standard says tables must not be used as layout aids. It defines caption as the title of the table and lists the scope values for header cells: row, col, rowgroup, colgroup and auto.
Forms and validation
Form questions are easy to get wrong, because small defaults change what happens on submit. The table lists the rules a good HTML practice test checks.
| Rule | What the official reference says |
|---|---|
| Default button type | A button inside a form with no valid type acts as submit (MDN button reference) |
| Labels | The for value matches the control’s id; clicking the label focuses the control (MDN label reference) |
| Email inputs | An empty type="email" field is valid unless it has required (MDN email input reference) |
| Security | Browser validation is not a substitute for checking the data on the server (MDN email input reference) |
Semantic HTML and accessibility
Semantic questions check that you pick the element that says what the content is. The MDN reference for the main element says a document must not have more than one main element without the hidden attribute. Repeated content such as navigation links, sidebars, logos and copyright notices stays outside it.
Accessibility questions test what native HTML gives you for free. The MDN guide to the ARIA button role says role="button" on a div adds no click or keyboard behaviour, so you should generally use a real button, which works with Enter and Space. Questions may also refer to WCAG 2.2, which has three conformance levels (A, AA and AAA). Its success criterion 1.1.1, Non-text Content, is Level A and is the reason alt text matters.
SEO metadata, Core Web Vitals and modern elements
SEO metadata questions should follow what search engines publish, not folklore. Google Search Central’s list of meta tags Google supports says the keywords meta tag “is not used by Google Search”. It says the meta description is sometimes used for the search snippet. The viewport tag tells the browser how to render the page on a mobile device, and its presence tells Google the page is mobile friendly.
Core Web Vitals questions check the “good” thresholds from web.dev’s Web Vitals guide, measured at the 75th percentile of page loads, for mobile and desktop separately. Interaction to Next Paint (INP) became a stable Core Web Vital in 2024, replacing First Input Delay.
| Metric | Good result |
|---|---|
| Largest Contentful Paint (LCP) | 2.5 seconds or less |
| Interaction to Next Paint (INP) | 200 milliseconds or less |
| Cumulative Layout Shift (CLS) | 0.1 or less |
The clearest HTML link is layout shift: MDN says width and height on an image let the browser reserve space before it loads. MDN adds that these attributes matter even more on images with loading="lazy".
Three modern elements are worth knowing well:
dialog: the MDN dialog reference saysshowModal()makes the rest of the page inert and can be closed with Esc, whileshow()and theopenattribute give a non-modal dialog. A form withmethod="dialog"closes the dialog and sets itsreturnValue.popover: the MDN popover reference saysautopopovers can be light dismissed, whilemanualpopovers must be closed explicitly. A button withpopovertargetopens one without JavaScript.details: the MDN details reference notes thatopenis a Boolean attribute, soopen="false"still shows the content. Giving severaldetailselements the samenamemakes an accordion where only one is open.
Exametics practice tests
HTML Practice Tests
- 7 practice tests with 40 questions each: 280 questions in total
- Rebuilt in November 2026 and checked against the HTML Living Standard and MDN
- Every answer explained, with a hint, and tagged with one of ten topic areas
- Timed Exam Mode test
- Lifetime access
30-day refund. Instant access after payment.
Who these HTML practice tests are for
These HTML practice tests suit anyone who writes or reviews web pages and wants an honest check of what they know: web developers, students, digital marketers who edit templates and metadata, and job seekers before a front-end interview.
They are a knowledge and interview-preparation bank, not a copy of any exam. The table shows what each level should be able to do.
| Level | What you should be able to do |
|---|---|
| Beginner | Write a valid page with a DOCTYPE, head and body; use headings, paragraphs, lists, links and images with sensible alt text. |
| Intermediate | Build accessible forms with labels and validation, mark up data tables with headers and captions, and choose semantic elements over generic divs. |
| Job-ready | Explain script loading, responsive images, metadata for search and sharing, Core Web Vitals, and when to use dialog, popover and details. |
Is there an official HTML certification?
No single official certification covers HTML on its own. The WHATWG publishes the HTML standard but no exam, so any “HTML certificate” comes from a training provider rather than the standard’s owner. Our guide to the JSE-40-01 JavaScript certification format and topics is a good next read, and the OutSystems Front-end Developer exam guide covers a low-code route.
Next on your web development path
- CSS3 practice tests: the natural next step once your markup is solid, from the cascade to flexbox and grid.
- JavaScript interview questions practice tests: for job seekers who need to script the DOM they have just learned to build.
- SEO practice tests: for marketers who want to take metadata and Core Web Vitals further.
How to prepare with an HTML practice test in 2–3 weeks
Take one practice test first to find your weak topics, then spend two to three weeks fixing them with the HTML standard, MDN and small pages you build and check yourself.
- Days 1–2: Baseline Take one untimed practice test and list the topics where you lost marks. Then write a full page from memory and compare it with the sample in the HTML standard.
- Days 3–6: Structure, links, media and tables Rebuild a news article with
header,nav,main,articleandfooter. Add responsive images withwidth,heightandalt, and a data table with acaptionandscopeon every header cell. - Days 7–10: Forms and accessibility Build a sign-up form with labelled inputs,
required,type="email"and onetype="button"button. Use it with the keyboard only and fix anything you cannot reach. - Days 11–14: Metadata, performance and modern elements Add a title, meta description and viewport tag, move scripts to
defer, and replace a JavaScript modal withdialogand a menu withpopover. Then take the next HTML practice test. - Days 15–21: Timed practice and review Take the timed Exam Mode test, read every explanation, and repeat the test where your weakest topic scored lowest.
Tip
When you miss a question, build the snippet and open it in a browser. Seeing what the browser really does sticks far better than re-reading a rule.
Planning more than one exam?
If HTML is the first step towards CSS, JavaScript or a front-end certification, the All-Access Pass covers every practice test on Exametics, including new exams as they are added, with lifetime access. It costs less than buying about six single practice tests.
Free HTML practice questions (10 with answers)
Try these 10 free HTML practice questions as a quick HTML quiz before you start a full practice test. These sample questions are each labelled with their topic, and the answer stays hidden until you select “Show answer”.
All 10 follow the current HTML Living Standard and MDN. The full Exametics HTML practice tests have 280 more questions like these, each with an explanation and a hint.
Practice question 1 · Document structure
Where must a <meta charset="utf-8"> declaration appear for it to be valid?
- A. On the first line of the file, before the DOCTYPE
- B. Anywhere inside the
bodyelement - C. Inside
head, entirely within the first 1024 bytes of the document - D. Anywhere inside
head, as long as it comes before the closing</head>tag
Show answer
Answer: C. MDN states that a meta element declaring the character encoding must sit entirely within the first 1024 bytes of the document, so it goes in head, usually straight after the opening tag. A is wrong because the DOCTYPE comes first and the meta element belongs in head. B is wrong because a charset declaration is metadata for the head, not body content. D is too loose: a long head can push the declaration past the 1024-byte limit.
Practice question 2 · Links
In a current browser, what happens when a user follows this link? <a href="https://example.com/" target="_blank">Partner site</a>
- A. It opens in a new tab and behaves as if
rel="noopener"were set, so the new page gets no access towindow.opener - B. It opens in a new tab, and the new page can redirect the original tab through
window.opener - C. It opens in the same tab, because
targetneedsrelto work - D. The browser blocks it as a pop-up
Show answer
Answer: A. MDN says that in newer browsers target="_blank" implicitly gives the same behaviour as rel="noopener", so window.opener is not set. B describes the old risk in browsers without that protection. C is wrong because target works without any rel value. D is wrong because target="_blank" only chooses where the link opens; it does not ask the browser to block anything.
Practice question 3 · Media
Why should you add width and height attributes to an img element, even when CSS sets its display size?
- A. They make the browser download a smaller version of the file
- B. Without them,
loading="lazy"is ignored - C. They always override any width set in CSS
- D. They let the browser work out the aspect ratio and reserve space before the image loads, which reduces layout shift
Show answer
Answer: D. MDN explains that the two attributes let the browser calculate the aspect ratio and reserve space, reducing or preventing a layout shift. A is wrong because choosing a smaller file is the job of srcset and sizes. B is wrong: loading="lazy" is not ignored, although MDN says the dimensions are especially important for lazy-loaded images. C is wrong because CSS can still resize the image.
Practice question 4 · Tables
A data table has a top row of headings, one for each column. Which markup correctly marks a heading cell for its column?
- A.
<td class="header">Price</td> - B.
<th scope="col">Price</th> - C.
<th scope="column">Price</th> - D.
<caption>Price</caption>above each column
Show answer
Answer: B. A th element is a header cell, and the HTML standard defines scope="col" as applying the header to cells in the same column. A only changes styling; a td with a class is still a data cell. C uses a value the standard does not define, so it falls back to the auto state. D is wrong because caption is the title of the whole table and a table has only one.
Practice question 5 · Forms
A script shows a tip when the button in this form is clicked. What else happens on click?<form action="/signup" method="post"><input type="text" name="user"><button>Show tips</button></form>
- A. Nothing else: a button without a
typedoes nothing by default - B. The form is submitted to
/signup, because a button in a form with notypeis a submit button - C. The form fields are reset to their starting values
- D. The browser shows a validation error because
typeis required
Show answer
Answer: B. MDN says submit is the default for a button associated with a form when type is missing, empty or invalid. So the click also submits the form. Add type="button" for script-only buttons. A describes type="button". C describes type="reset". D is wrong because type is optional.
Practice question 6 · Forms
A form has <input type="email" name="email"> with no other attributes. The user leaves it empty and submits. What does built-in browser validation do?
- A. It submits the form but marks the field as invalid on the server
- B. It blocks submission because the value is not an email address
- C. It fills in the email address saved in the browser before submitting
- D. It accepts the empty value and lets the form submit
Show answer
Answer: D. MDN says an email input is valid when empty, and only becomes invalid when empty if it has the required attribute. A is wrong because the browser never marks anything on the server; and since HTML validation can be bypassed, the server must check the data itself. B would happen only with required, or with a non-empty value that is not a valid address. C is wrong because autofill is a user choice, not part of validation.
Practice question 7 · Semantic HTML
Which statement about the main element is correct?
- A. Every
articleneeds its ownmainelement - B. A page may have two visible
mainelements if each has anaria-label - C. The site navigation and copyright footer should go inside
main - D. A document may have only one
mainelement without thehiddenattribute, and content repeated across pages stays outside it
Show answer
Answer: D. MDN says a document must not have more than one main element that does not have the hidden attribute, and that repeated content such as navigation, sidebars, logos and copyright information should not be inside it. A is wrong because main wraps the page’s central content, which can contain several articles. B is wrong because labels do not lift the limit of one visible main. C puts exactly the repeated content MDN says to leave out.
Practice question 8 · Accessibility
A page uses a purely decorative divider image. Which markup is best for screen-reader users?
- A.
<img src="divider.svg">with noaltattribute - B.
<img src="divider.svg" alt=""> - C.
<img src="divider.svg" alt="image"> - D.
<img src="divider.svg" title="divider">with noaltattribute
Show answer
Answer: B. MDN says an empty alt tells assistive technology that the image is not a key part of the content, so it can be skipped. A is wrong because, with no alt, some screen readers announce the file name instead. C adds noise: MDN says alt text should not describe the presence of the image itself, and uses alt="image" as its example of what not to do. D is wrong because title does not replace alt and the image is still missing a text alternative.
Practice question 9 · SEO metadata
According to Google Search Central, which of these tags is not used by Google Search and has no effect on indexing or ranking?
- A.
<title> - B.
<meta name="description"> - C.
<meta name="keywords"> - D.
<meta name="viewport">
Show answer
Answer: C. Google Search Central states that the keywords meta tag is not used by Google Search and has no effect on indexing and ranking. A is wrong because title is a normal element of the page head, not a meta tag, and Google’s statement is about the keywords meta tag only. B is wrong because Google says the description is sometimes used in the search snippet. D is wrong because Google says the viewport tag controls mobile rendering and that its presence tells Google the page is mobile friendly.
Practice question 10 · Modern HTML elements
A script opens <dialog id="confirm"> with confirm.showModal(). The dialog has no closedby attribute. What happens when the user presses Esc?
- A. The dialog closes, because a dialog opened with
showModal()can be dismissed with Esc by default - B. The dialog closes and the page reloads
- C. The dialog stays open, because Esc only works on dialogs opened with the
openattribute - D. Nothing: a dialog can only be closed by calling
close()
Show answer
Answer: A. MDN says a dialog opened with showModal() can be dismissed with Esc by default; without closedby it behaves as closerequest. D describes closedby="none". B is wrong because closing a dialog does not reload the page. C has it backwards: MDN says a non-modal dialog, such as one shown with the open attribute, does not close with Esc by default.
How did you score?
8–10 correct: take a full timed test in Exam Mode to check your speed. Under 8: revise the topic you missed most in the sections above, then try again. The HTML practice tests have 280 more questions like these, each with a hint and a full explanation.
Common mistakes in HTML practice tests
Many wrong answers in an HTML practice test come from habits learned from old tutorials. These five are worth checking in your own markup.
- Using obsolete presentational markup. The obsolete features section of the HTML standard says
cellpadding,cellspacing,alignandborderon tables must not be used, and thatcenter,font,marqueeandframesetare obsolete. Use CSS instead. - Forgetting the default button type. A plain
buttonin a form submits it. Usetype="button"for buttons that only run a script. - Writing
open="false". MDN notes thatopenondetailsis a Boolean attribute, so this still shows the content. Remove the attribute to hide it. - Building controls from
divs. Adivwith a click handler is not focusable and does not respond to Enter or Space. A realbuttondoes both. - Treating HTML validation as security.
requiredandtype="email"help users, but anyone can bypass them. Check data on the server.
Once your markup is solid, our guide to CSS3 practice tests on layout, flexbox and grid is the natural next step. If you work on search, read SEO practice tests that check your search fundamentals. For interviews, see JavaScript interview questions on closures, async code and the DOM.
HTML practice test FAQs
How many questions are in the Exametics HTML practice tests?
The Exametics HTML Practice Tests have 7 practice tests with 40 questions each, 280 questions in total, including a timed Exam Mode test. They are a knowledge and interview-preparation bank, not a copy of any official exam.
Are there free HTML practice questions?
Yes. This post has 10 free HTML practice questions with answers and explanations, covering document structure, links, media, tables, forms, semantic HTML, accessibility, SEO metadata and the dialog element. The full Exametics HTML practice tests have 280 more questions like these.
Is there an official HTML certification?
No single official certification covers HTML on its own. The WHATWG maintains the HTML Living Standard but does not publish an exam, so HTML certificates come from training providers rather than from the standard’s owner.
Which version of HTML should I learn in 2026?
Learn the HTML Living Standard. The WHATWG updates it continuously instead of releasing numbered versions, and its introduction says the W3C and WHATWG agreed in 2019 to work on this single version of HTML.
Is HTML hard to learn, and how long should I prepare?
Basic HTML is quick to learn, but practice tests check details such as form defaults, accessible markup, metadata and modern elements like dialog and popover. If you already build simple pages, two to three weeks of focused practice with an HTML practice test, the HTML standard and MDN is a realistic plan.
Should I learn HTML, CSS or JavaScript first?
Start with HTML, because CSS styles HTML elements and JavaScript works with the page structure HTML creates. Once you can write valid, semantic and accessible markup, move on to CSS and then JavaScript.
Can an HTML practice test help me prepare for a front-end interview?
Yes. The Exametics HTML practice tests are built as a knowledge and interview-preparation bank for web developers, students, digital marketers and job seekers. Every answer explains why the right option is right and why the others are wrong, which helps you explain your choices in an interview.
Official sources: HTML Living Standard (WHATWG) and MDN Web Docs: HTML. Checked on 9 November 2026.
Test your HTML with 280 practice questions
Seven practice tests cover modern HTML, from document structure and forms to accessibility, SEO metadata, Core Web Vitals and the dialog, popover and details elements. Every answer is explained, with a hint, so you learn from each mistake.
✓ Every answer explained · ✓ Timed exam mode · ✓ 30-day refund