Fundamentals of Front End Development MCQs with Answers
Practice important Fundamentals of Front End Development MCQs with answers and explanations.
Chapter: 8
Q101:
Which HTML element defines the whole document?
A. <body>
B. <html>
C. <head>
D. <title>
Correct Answer:
B
Chapter: 8
Q102:
How are nested HTML elements represented?
A. Elements are not nested
B. Elements can contain other elements
C. Only certain elements can be nested
D. Nested elements are not allowed
Correct Answer:
B
Chapter: 8
Q103:
Fill in the blank: The <h1> tag is used to define a ______.
A. Paragraph
B. Heading
C. Image
D. Link
Correct Answer:
B
Chapter: 8
Q104:
Fill in the blank: An HTML element with no content is called a ______ element.
A. Text
B. Nested
C. Empty
D. Non-standard
Correct Answer:
C
Chapter: 8
Q105:
What is the purpose of the
A. To define a line break
B. To create a paragraph
C. To add a heading
D. To insert an image
Correct Answer:
A
Chapter: 8
Q106:
Which attribute is used to declare the document language in HTML?
A. href
B. src
C. lang
D. title
Correct Answer:
C
Chapter: 8
Q107:
What attribute specifies an alternative text for an image when it cannot be displayed?
A. alt
B. src
C. title
D. href
Correct Answer:
A
Chapter: 8
Q108:
Fill in the blank: HTML attributes are always specified in the ______ tag.
A. End
B. Start
C. Content
D. Header
Correct Answer:
B
Chapter: 8
Q109:
What attribute is used to define the size of an image in HTML?
A. src
B. width and height
C. alt
D. title
Correct Answer:
B
Chapter: 8
Q110:
Which of the following is true about attribute values in HTML?
A. They do not need to be quoted
B. They must always be quoted
C. Single quotes are not allowed
D. Double quotes are mandatory
Correct Answer:
B
Chapter: 8
Q111:
Fill in the blank: The <a> tag is used to define a ______ in HTML.
A. Paragraph
B. Heading
C. Link
D. Image
Correct Answer:
C
Chapter: 8
Q112:
What is the correct way to write a link with an href attribute in HTML?
A. <a href=http://www.example.com>
B. <a href="http://www.example.com">
C. <a link="http://www.example.com">
D. <a url="http://www.example.com">
Correct Answer:
B
Chapter: 8
Q113:
Which tag would you use to insert a line break in HTML?
A. <p>
B. <break>
D. <hr>
Correct Answer:
C
Chapter: 8
Q114:
Fill in the blank: The <p> tag in HTML is used to define a ______.
A. Heading
B. Paragraph
C. Link
D. Image
Correct Answer:
B
Chapter: 9
Q115:
What does the <h1> tag define in HTML?
A. The least important heading
B. The most important heading
C. A paragraph
D. A line break
Correct Answer:
B
Chapter: 9
Q116:
Which tag is used to define a paragraph in HTML?
A. <p>
B. <header>
C. <section>
D. <line>
Correct Answer:
A
Chapter: 9
Q117:
Fill in the blank: HTML headings range from <h1> to <h6>, with <h1> being the ________.
A. Least important
B. Most important
C. Middle level
D. Largest
Correct Answer:
B
Chapter: 9
Q118:
What is the purpose of the <title> element in an HTML document?
A. To define a heading
B. To define meta data
C. To set the document's title in the browser tab
D. To display a line break
Correct Answer:
C
Chapter: 9
Q119:
Fill in the blank: The <meta> element can define the _______ of an HTML document.
A. Title
B. Character set
C. Paragraphs
D. Headings
Correct Answer:
B
Chapter: 9
Q120:
What happens to extra spaces and extra lines in HTML code when the page is displayed?
A. They are preserved
B. They are converted into a new line
C. They are removed
D. They are displayed as-is
Correct Answer:
C