Correct Answers/Verified
Why should the document type declaration be included in all HTML documents? - ✔✔To
specify the HTML standard being used in the document.
Which of the following is the current HTML standard? - ✔✔HTML5
The contents of the <title> tag will appear where in a modern browser? - ✔✔The browser's
tab or title bar
All HTML code must be nested within which of the following tags? - ✔✔<html>
Which of the following tags would contain the HTML for a web page's visible content? -
✔✔<body>
The following HTML code should only exist within which one of the following tags?
<title>Codecademy</title> - ✔✔<head>
Which of the following tags instructs the browser to expect a well-formed HTML document?
- ✔✔<!DOCTYPE html>
Which of the following tags contains metadata about the webpage? - ✔✔<head>
The acronym "HTML" stands for which of the following? - ✔✔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> - ✔✔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? - ✔✔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>
</ol> - ✔✔List items must be added to list
How many different heading elements does HTML support? - ✔✔6
Which of the following is the best way of improving the code below?
<img src="https://www.codecademy.com/laptop.jpg" /> - ✔✔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 /> - ✔✔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? - ✔✔Name, Value
Which of the following tags can be used to add a paragraph to a web page? - ✔✔<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> - ✔✔Add the target attribute,
with its value set to _blank
The following code is supposed to to create a link to another web page, but fails to do so.
Why?
, <a>Codecademy</a> - ✔✔The <a> element is missing the href attribute set to the URL of
the Code academy website.
How would the output of the code below change if <ul> and </ul> were changed to <ol> and
</ol>, respectively?
<ul>
<li>Lorem</li>
<li>Ipsum</li>
<li>Horribilis</li>
</ul> - ✔✔Bullet points in the output would change to numbers
According to the W3C recommendation, what's the appropriate way of indenting nested
HTML elements? - ✔✔2 spaces
Which of the following elements will directly affect the vertical spacing in an HTML layout? -
✔✔<br />
: Separating HTML and CSS into their own files helps accomplish which of the following? -
✔✔Separating HTML structure from CSS style to make code easier to read and reuse.
You wish to link a CSS file called main.css to an HTML file. Which of the following lines of
code correctly links the HTML file and the stylesheet?
// 1
<link href="main.css" type="stylesheet" rel="text/css" />
// 2
<link href="main.css" type="stylesheet" rel="css/text" />
// 3
<link href="main.css" type="text/css" rel="stylesheet" />
// 4
<link href="main.css" type="css/text" rel="stylesheet" /> - ✔✔3