Which HTML element contains metadata like the page title and links to stylesheets?
<body>
<head>
<title>
<meta>
Answer: B) <head>
<title>
element in an HTML document?a) Displays a heading on the webpage
b) Defines the title shown on the browser tab
c) Adds a tooltip to elements
d) Creates a paragraph
Answer: b) Defines the title shown on the browser tab
a) <head>
b) <body>
c) <title>
d) <meta>
Answer: b) <body>
a) <para>
b) <p>
c) <paragraph>
d) <pg>
Answer: b) <p>
a) <h6>
b) <h3>
c) <h1>
d) <h5>
Answer: c) <h1>
<br>
tag in HTML?a) Creates a horizontal line
b) Breaks text into a new paragraph
c) Creates a line break
d) Bolds text
Answer: c) Creates a line break
a) <hr>
b) <br>
c) <line>
d) <hl>
Answer: a) <hr>
<img>
tag to specify the image file?a) alt
b) src
c) href
d) title
Answer: b) src
<em>
tag?a) Makes text bold
b) Makes text italicized for emphasis
c) Creates a new paragraph
d) Underlines text
Answer: b) Makes text italicized for emphasis
<code>
tag?a) Displays a preformatted block of code
b) Highlights text in yellow
c) Creates a clickable button
d) Creates a hyperlink
Answer: a) Displays a preformatted block of code
a) <q>
b) <blockquote>
c) <cite>
d) <quote>
Answer: b) <blockquote>
<pre>
tag is used to…a) Add metadata to the HTML document
b) Preserve whitespace and formatting in text
c) Highlight text
d) Create a paragraph
Answer: b) Preserve whitespace and formatting in text
a) Inline elements take up full width, block elements do not
b) Block elements always have a border
c) Inline elements do not start on a new line, block elements do
d) There is no difference
Answer: c) Inline elements do not start on a new line, block elements do
a) <h1>
b) <p>
c) <em>
d) <blockquote>
Answer: c) <em>
Here are more multiple-choice questions (MCQs) on HTML elements:
a) <span>
b) <strong>
c) <div>
d) <em>
Answer: c) <div>
a) <b>
b) <strong>
c) <i>
d) <u>
Answer: b) <strong>
<img>
tag require to display an image?a) href
b) alt
c) src
d) title
Answer: c) src
<p>
tag in HTML is used for?a) Adding paragraphs
b) Creating tables
c) Displaying images
d) Creating lists
Answer: a) Adding paragraphs
<br>
tag?a) Adds a horizontal line
b) Adds a page break
c) Inserts a line break
d) Bolds text
Answer: c) Inserts a line break
<b>
and <strong>
tags?a) <b>
is obsolete, <strong>
is not
b) <strong>
indicates importance, <b>
only makes text bold
c) <b>
is used for larger text, <strong>
is for emphasis
d) There is no difference
Answer: b) <strong>
indicates importance, <b>
only makes text bold
a) <p>
b) <pre>
c) <blockquote>
d) <code>
Answer: b) <pre>
a) <div>
b) <span>
c) <section>
d) <article>
Answer: b) <span>
a) <q>
b) <blockquote>
c) <quote>
d) <cite>
Answer: b) <blockquote>
alt
attribute in the <img>
tag?a) Adds a caption to the image
b) Provides alternative text for accessibility
c) Changes the image size
d) Links the image to another page
Answer: b) Provides alternative text for accessibility
a) <p>
b) <div>
c) <br>
d) <span>
Answer: c) <br>
<p>
tag?a) Inline
b) Inline-block
c) Block
d) Flex
Answer: c) Block
a) <div>
b) <span>
c) <p>
d) <br>
Answer: a) <div>
<em>
tag do to the enclosed text?a) Makes it bold
b) Italicizes it for emphasis
c) Underlines it
d) Highlights it
Answer: b) Italicizes it for emphasis
a) // This is a comment
b) /* This is a comment */
c) <!-- This is a comment -->
d) <comment>This is a comment</comment>
Answer: c) <!-- This is a comment -->
<img>
tag’s src
attribute is missing?a) The browser shows an error message
b) The image is replaced with a broken image icon
c) The page does not load
d) Nothing happens
Answer: b) The image is replaced with a broken image icon
a) <cite>
b) <blockquote>
c) <q>
d) <cite>
Answer: a) <cite>
a) <div>
b) <section>
c) <article>
d) <header>
Answer: c) <article>
Learn the basics of HTML, including elements, attributes and forms controls.