This website uses cookies to ensure you get the best experience on our website.
HTML Test
Exam Type: | HTML MCQ Skill Test |
Questions Type: | Multiple Choice Questions |
Total Questions: | 40 |
Time Limit: | 30 Minutes |
Last Update | June, 2025 |
Pass HTML Exam

1 minute 2 seconds

1 correct answers

6 incorrect answers

6 not attempted
HTML Quiz
What is the purpose of the <track> tag, and when should it be used?
- The <track> tag is used for specifying subtitles. It is typically applied as a child of the <video> tag.
- The <track> tag is used for specifying subtitles. It is typically applied as a child of the <audio> and <video> tags.
- The <track> tag is used for specifying subtitles, captions, and other types of time-based text. It is typically applied as a child of the <audio> and <video> tags.
-
The <track> tag is used for specifying subtitles, captions, and other types of time-based text. It is typically applied as a child of the<video> tag.
What are the best examples of void elements?
<input>
<br>
<p>
<area>
<embed>
<strong>
<link>
<meta>
<title>
<wbr>
<base>
<source>
In HTML5, which tag or tags embed a webpage inside of a webpage?
<iframe>
<frame>
"<frame>" and
<frameset>
"<iframe>", "<frame>", and
<frameset>
Where do <header> and <footer> tags typically occur?
- as children of <body>, <article>, <table>, and <section> tags
- as children of <body>, <article>, <aside>, and <section> tags
- as children of <body>, <article>, <aside>, <nav>, and <section> tags
-
as children of <body>, <article>, and <section> tags
When is the <link> tag used?
- when linking style sheets and favicons
- when linking style sheets, external URLs, and favicons
- when linking style sheets, favicons, and preloading assets
-
when linking style sheets, JavaScript, and icons for mobile apps
What should fill the two blanks in the HTML code below?
<address ____ _______>
<span itemprop=”streetAddress”>
6410 Via Real
</span><br>
<span itemprop=”addressLocality”>Carpinteria</span>
<span itemprop=”addressRegion”>CA</span>
<span itemprop=”postCode”>93013</span>
</address>
- Itemscope itemtype=”http://schema.org/postAddress”
- itemref=”http://schema.org/PostalAddress”itemid=”address”
- Itemscope itemref=”http://schema.org/PostalAddress”
-
itemid=”address” itemtype=”http://schema.org/postalAdress”
When should you use the <aside> element?
- for anything in a sidebar.
- for anything in parentheses.
- when the content can be removed without detracting from the page’s message.
-
for anything you want to move to the side, like a pull quote box, a sidebar, or an image with text wrapping around it.
With which tags is the <source> element associated?
- <picture>, <audio>, and <video>
- <audio> and <video>
- It is interchangeable with the src attribute, so any element which uses src may use <source> instead.
-
<svg>, <picture>, <audio>, and <video>
What is NOT a valid attribute for the <textarea> element?
- spellcheck
- form
- readonly
-
Max
What is the difference between the <div> and <span> tags?
- <div> is used where a generic inline tag is needed, while <span> is used where a generic block-level tag is needed.
- <div> is the industry-standard default tag, but you could use <span> if you prefer.
- <div> is used for major divisions on a page, while <span> is used to span across columns.
-
<div> is used where a generic block-level tag is needed, while <span> is used where a generic inline tag is needed.
What should fill the blank in the HTML code below?
<form method="post" action="mailto:[email protected]" _____="text/plain" >
rel
enctype
type
Media
In the code below, what is the purpose of the id attribute?
<p id="warning">Be careful when installing this product.</p>
- It establishes that id is a unique identifier in the document, used for styling CSS, scripting, and linking within a webpage.
- It establishes that id is a unique identifier in the document, used for styling CSS and with JavaScript code.
- It establishes that id is a unique identifier in the website, used for styling CSS, scripting, and linking within a webpage.
-
It establishes that id may be used for styling CSS several times per page.
What should fill the blank in the HTML code below?
<a href="https://es.yahoo.com/" hreflang="_____" target="_blank">Visita Yahoo</a>
- es-spanish
- es-es
- spanish
-
es
What is the “<hr>” tag typically used for?
- This tag is deprecated and should not be used.
- It designates a topic shift within a section at the paragraph level.
- It draws a horizontal line.
-
It designates a shift of topic at the section level.
What should fill the two blanks in the HTML code below?
<section itemscope itemtype=”http://schema.org/restaurant”>
<h1 itemprop=”name”> Nadia’s Garden</h1>
<p itemscope ------------ --------->
<span itemprop=”ratingvalue”>4.5</span> stars -
based on <span itemprop=”reviewcount”>120</span> reviews
</p>
</section>
- itemprop=”aggregateRating” itemref=”http://schema.org/AggregateRating”
- itemprop=”aggregateRating” itemtype=”http://schema.org/AggregateRating”
- itemid=”aggregateRating” itemtype=”http://schema.org/AggregateRating”
- itemid=”aggregateRating” itemref=”http://schema.org/AggregateRating”
Which three tags were deprecated in HTML4 but returned to HTML5?
<rb>
<rp>
<rt>
<acronym>
<code>
<wbr>
<hgroup>
<q>
<wbr>
<b>
<i>
<u>
The _____ tag is used for marking up a short code snippet, while the _____ tag is used for marking up a longer block of code.
“<kbd>”;
<pre>
“<pre>”
<code>
“<kbd>”;
<mark>
“<code>”;
<pre>
What does the <label> tag do?
- It visually labels form fields.
- It labels webpages with important information.
- It visually associates a text label with an interface element.
- It programmatically associates a text label with an interface element.
To get a link to open in a new window or tab, use the _____ value for the target attribute.
- _self
- _new
- _parent
- _blank
What's the most semantically accurate way to mark up the sentence shown below? Note: "TLAs" stands for "three-letter acronyms."
- <p>We are fond of our <acronym title="three-letter acronyms">TLAs</acronym> in web design.</p>
- <p>We are fond of our <span title="three-letter acronyms">TLAs</span> in web design.</p>
- <p>We are fond of our <abbr title="three-letter acronyms">TLAs</abbr> in web design.</p>
- <p>We are fond of our TLAs in web design.</p>
What should fill the blank below?
<link href="phone.css" rel="stylesheet" _____ ="print">
type
device
title
Media
Which choice uses the correct terminology in describing this markup: <p>info</p>?
The element opener is <p>, the element closer is </p>, and the element information is info.
The start tag is <p>, the end tag is </p>, and the enclosed HTML is info.
The start tag is <p>, the end tag is </p>, and the element content is info.
The start element is <p>, the end element is </p>, and the tag content is info.
What is the difference between <input type="submit" value="click me"> and <button type="submit">Click me</button>?
- There is no difference. Both will render a button that submits a form.
- The <input type="button"> has been deprecated in HTML5. You should use the <button> tag instead.
- Both will submit a form. However, the <button> can have content other than text, like an image or nested HTML elements, while the <input> cannot.
-
Both will submit a form. However, the <input> can have content other than text, like an image or nested HTML elements, while the <button> cannot.
What is the best semantic way to indicate that text refers to keyboard entry?
<p>Press the <tt>Enter</tt> key to proceed.</p>
<p>Press the <kbd>Enter</kbd> key to proceed.</p>
<p>Press the Enter key to proceed.</p>
<p>Press the <samp>Enter</samp> key to proceed.</p>
What attribute applies a keyboard shortcut hint to the current element?
shortcut
access
accesskey
keyboard
What is the correct way to code a link that, when clicked, will send an email to [email protected] with a subject of "Hello"?
- <a href="mailto:[email protected]>Hello</a>
- <a href="mailto:[email protected]?&subject=Hello">Click me</a>
- <a href="mailto:[email protected]&subject=Hello">Click me</a>
- <a href="mailto:[email protected]?subject=Hello">Click me</a>
What is the semantic method for marking up a video with a caption in browsers that support it?
- <video src="video.mp4" caption="video.vtt"></video>
- <video src="video.mp4"><track caption="video.vtt" /></video>
- <video src="video.mp4"><track default kind="captions" srclang="en" src="video.vtt" /></video>
- <video src="video.mp4"><caption default srclang="en" src="video.vtt" /></video>
What is the root element of an HTML document?
- <body>
- <html>
- <root>
- <!DOCTYPE html>
Which code snippet creates the layout shown, starting at <table> and ending at </table>?
<tr>
<td>Table cell 1</td>
<td>Table cell 2</td>
</tr>
<tr>
<td rowspan="2">Table cell 3</td>
</tr>
<tr>
<td>Table cell 1</td>
<td>Table cell 2</td>
</tr>
<tr>
<td colspan="2">Table cell 3</td>
</tr>
<tr>
<td>Table cell 1</td>
<td>Table cell 2</td>
</tr>
<tr>
<td>Table cell 3</td>
</tr>
<tr>
<td>Table cell 1</td>
<td>Table cell 2</td>
<td>Table cell 3</td>
</tr>
Which choice is NOT a legal value for the name attribute within a <meta> tag?
charset
viewport
generator
Author
What does the poster attribute do in the <video> tag?
It specifies an image that should display while the video downloads and until the video is played.
It specifies an image that only displays if there is a problem with the video.
It specifies an image that should display until the video is played.
It specifies an image that should display while the video downloads
What does this code do?
<audio controls src="sound.mp3" type="audio/mpeg">When does this text display?</audio>
- The text displays under the audio controls.
- The text displays when the browser cannot play the sound.
- The text displays over the audio controls, unless CSS is used to position it elsewhere.
- The text never displays.
What is the primary purpose of the <canvas> tag?
- It allows raster images to be rendered on the webpage.
- It displays annotated images.
- It allows drawing on a bitmap via JavaScript.
- It allows vector images to be rendered on the webpage.
Which choice contains three valid block-level elements?
- <details> <abbr> <figcaption>
- <canvas> <select> <noscript>
- <dt> <table> <pre>
- <kbd> <p> <main>
In the code below, what is "target"?
<a href="http://www.linkedin.com" target="_blank">Visit site</a>
a tag
an element
an attribute
content
Which image formats can be displayed by all web browsers?
- JPG, TIF, BMP
- PNG, GIF, JPG
- TIF, BMP, GIF
- JPG, GIF, TIF
What is the correct way to code a comment in HTML?
- /* this is a comment */
- //this is a comment
- <!-- this is a comment -->
- <! this is a comment ->
When should you use the "<article>" element?
- to associate comments with a blog post
- for blog posts and other social media items
- for the main content area of your website
- when the content stands alone as a unit, is suitable for syndication, or is reusable
What does the <wbr> tag do?
- It presents an opportunity for a break in a very long word, if needed for proper page display.
- It requires the browser to wrap the current line at that point.
- It breaks a word into two pieces, using a hyphen to connect the words.
-
It formats the sentence to be easily breakable.
What is the difference between the readonly and disabled attributes for the <textarea> element?
- readonly allows clicking in the <textarea> element. disabled prevents all interaction with the control.
- disabled allows clicking in the <textarea> element. readonly prevents all interaction with the control.
- disabled is an invalid attribute for <textarea>, while readonly is a valid attribute.
- readonly is an invalid attribute for <textarea>, while disabled is a valid attribute.