HTML Quiz
Questions: 16 · 10 minutes
1. Which semantic element is intended for a major group of navigation links?
<menuitem>
<aside>
<nav>
<section>
2. Which opening tag correctly declares that a document’s primary language is English?
<html language=""English"">
<head lang=""en"">
<html lang=""en"">
<language code=""en"">
3. Which element creates a numbered list?
<ol>
<dl>
<li>
<ul>
4. Which element represents the primary heading of a page or section?
<head>
<h1>
<header>
<title>
5. A form has <input id=""email"">. Which label markup explicitly associates the words “Email address” with that input?
<label id=""email"">Email address</label>
<label for=""email"">Email address</label>
<label name=""email"">Email address</label>
<label href=""email"">Email address</label>
6. Inside a form, which markup creates a button whose explicit purpose is to submit that form?
<button action=""submit"">Send</button>
<button method=""submit"">Send</button>
<button type=""submit"">Send</button>
<button href=""submit"">Send</button>
7. Which element identifies a header cell in an HTML table?
<thead>
<tr>
<th>
<td>
8. A company logo is also a link to the homepage. Which attribute on its <img> element should provide a useful text alternative?
alt
name
title
value
9. Which markup declares UTF-8 character encoding in an HTML document?
<meta encoding=""UTF-8"">
<charset value=""UTF-8"">
<html charset=""UTF-8"">
<meta charset=""UTF-8"">
10. You want a browser to prevent ordinary form submission when an email field has been left empty. Which attribute should you add to that input?
required
checked
selected
readonly
11. Which attribute specifies the destination of an HTML link?
src
action
target
href
12. You want a paragraph to visibly display the characters <main> as text rather than treat them as an HTML element. Which approach does that correctly?
Place quotation marks around the unescaped <main> markup
Place backslashes before both angle brackets
Use the nonexistent character reference &main;
Replace the angle brackets with < and > character references
13. A paragraph contains this incomplete markup: <p>Read <strong>this first. In which order should the open elements be closed?
Open another strong element, then close the paragraph
Close the paragraph first, then close the strong element
Close the strong element, then open another paragraph
Close the strong element first, then close the paragraph
14. The page URL is https://example.com/guides/html/index.html. Where does the relative link href=""../css/start.html"" point?
https://example.com/css/start.html
https://example.com/guides/css/start.html
https://example.com/guides/html/css/start.html
https://example.com/guides/html/start.html
15. A photo and its visible caption should be represented as one self-contained unit. Which markup is the best semantic choice?
<figure><img src=""photo.jpg"" alt=""...""><figcaption>...</figcaption></figure>
<picture><caption>...</caption></picture>
<section><img src=""photo.jpg"" alt=""...""><legend>...</legend></section>
<img src=""photo.jpg"" alt=""..."" caption=""..."">
16. Several elements on one page need the same styling hook. Which attribute is generally appropriate for assigning them a shared identifier?
id
class
for
name