HTML & CSS multiple choice Exam 2026
Questions and Answers
Why should the document type declaration be included in all HTML documents? -
Correct answer-To specify the HTML standard being used in the document.
Which of the following is the current HTML standard? - Correct answer-HTML5
The contents of the <title> tag will appear where in a modern browser? - Correct
answer-The browser's tab or title bar
All HTML code must be nested within which of the following tags? - Correct
answer-<html>
Which of the following tags would contain the HTML for a web page's visible
content? - Correct answer-<body>
The following HTML code should only exist within which one of the following
tags?
<title>Codecademy</title> - Correct answer-<head>
©COPYRIGHT 2025, ALL RIGHTS RESERVED 1
,Which of the following tags instructs the browser to expect a well-formed HTML
document? - Correct answer-<!DOCTYPE html>
Which of the following tags contains metadata about the webpage? - Correct
answer-<head>
The acronym "HTML" stands for which of the following? - Correct answer-
HyperText Markup Language
In the following code, the empty line of space between the heading and the first
paragraph is supposed to increase the vertical space between them in the browser,
but fails to do so. Why?
<a href="https://www.codecademy.com/">Codecademy</a> - Correct answer-In
an HTML file, whitespace does not affect the layout of a webpage because the
browser ignores it.
Which of the following best describes why HTML comments are important to web
development? - Correct answer-Comments clarify code and makes code easier to
understand for other developers
The following code results in no visible output in the browser. Why?
<ol>
©COPYRIGHT 2025, ALL RIGHTS RESERVED 2
, </ol> - Correct answer-List items must be added to list
How many different heading elements does HTML support? - Correct answer-6
Which of the following is the best way of improving the code below?
<img src="https://www.codecademy.com/laptop.jpg" /> - Correct answer-Include
an alt attribute and a description of the image.
The following code is supposed to display an image, but fails to do so. Why?
<img https://www.example.com/laptop.jpg /> - Correct answer-The src attribute is
missing and must be set equal to the image url, enclosed in double quotation
marks.
What are the two components of HTML attributes? - Correct answer-Name, Value
Which of the following tags can be used to add a paragraph to a web page? -
Correct answer-<p>
The following code creates a link to another page. Which of the following will
cause the page to open in a new browser window?
<a href="https://www.codecademy.com/">Codecademy</a> - Correct answer-Add
the target attribute, with its value set to _blank
©COPYRIGHT 2025, ALL RIGHTS RESERVED 3
Questions and Answers
Why should the document type declaration be included in all HTML documents? -
Correct answer-To specify the HTML standard being used in the document.
Which of the following is the current HTML standard? - Correct answer-HTML5
The contents of the <title> tag will appear where in a modern browser? - Correct
answer-The browser's tab or title bar
All HTML code must be nested within which of the following tags? - Correct
answer-<html>
Which of the following tags would contain the HTML for a web page's visible
content? - Correct answer-<body>
The following HTML code should only exist within which one of the following
tags?
<title>Codecademy</title> - Correct answer-<head>
©COPYRIGHT 2025, ALL RIGHTS RESERVED 1
,Which of the following tags instructs the browser to expect a well-formed HTML
document? - Correct answer-<!DOCTYPE html>
Which of the following tags contains metadata about the webpage? - Correct
answer-<head>
The acronym "HTML" stands for which of the following? - Correct answer-
HyperText Markup Language
In the following code, the empty line of space between the heading and the first
paragraph is supposed to increase the vertical space between them in the browser,
but fails to do so. Why?
<a href="https://www.codecademy.com/">Codecademy</a> - Correct answer-In
an HTML file, whitespace does not affect the layout of a webpage because the
browser ignores it.
Which of the following best describes why HTML comments are important to web
development? - Correct answer-Comments clarify code and makes code easier to
understand for other developers
The following code results in no visible output in the browser. Why?
<ol>
©COPYRIGHT 2025, ALL RIGHTS RESERVED 2
, </ol> - Correct answer-List items must be added to list
How many different heading elements does HTML support? - Correct answer-6
Which of the following is the best way of improving the code below?
<img src="https://www.codecademy.com/laptop.jpg" /> - Correct answer-Include
an alt attribute and a description of the image.
The following code is supposed to display an image, but fails to do so. Why?
<img https://www.example.com/laptop.jpg /> - Correct answer-The src attribute is
missing and must be set equal to the image url, enclosed in double quotation
marks.
What are the two components of HTML attributes? - Correct answer-Name, Value
Which of the following tags can be used to add a paragraph to a web page? -
Correct answer-<p>
The following code creates a link to another page. Which of the following will
cause the page to open in a new browser window?
<a href="https://www.codecademy.com/">Codecademy</a> - Correct answer-Add
the target attribute, with its value set to _blank
©COPYRIGHT 2025, ALL RIGHTS RESERVED 3