HTML Basics: 19 MCQs with answers

All 19 multiple-choice questions from this kit, free and with no sign-up.

Warm-up · 11 questions

Q1. Which HTML tag is used to define the root element of an HTML document?

Beginner
A <main> B <body> C <html> D <head>
Show answer & explanation

<html>

The element is the root of an HTML document, containing all other elements.

Q2. Which of the following is a semantic element in HTML5?

Beginner
A <article> B <b> C <span> D <div>
Show answer & explanation

<article>

is a semantic element that represents a self-contained composition, while and are non-semantic.

Q3. What is the purpose of the <head> element in an HTML document?

Beginner
A To hold navigation links B To define the footer of the page C To contain metadata and document title D To display the main content of the page
Show answer & explanation

To contain metadata and document title

The element contains metadata like the title, character set, and links to stylesheets, not visible content.

Q4. Which tag is used to create a hyperlink in HTML?

Beginner
A <nav> B <link> C <href> D <a>
Show answer & explanation

<a>

The (anchor) tag is used to create hyperlinks, with the href attribute specifying the destination.

Q5. What is the correct way to write a comment in HTML?

Beginner
A // comment B /* comment */ C <!-- comment --> D # comment
Show answer & explanation

<!-- comment -->

HTML comments are written between , and they are not displayed in the browser.

Q6. Which of the following is the correct structure for an HTML document?

Beginner
A <head><html></html></head> B <html><head></head><body></body></html> C <html><body></body><head></head></html> D <body><head></head></body>
Show answer & explanation

<html><head></head><body></body></html>

The standard structure is as root, containing and in that order.

Q7. What is the purpose of the <footer> element?

Beginner
A To hold navigation links B To define a footer for a section or page C To contain the main heading D To display images
Show answer & explanation

To define a footer for a section or page

typically contains information about the section, like author, copyright, or related links.

Q8. What does the <title> element do?

Beginner
A Creates a heading B Displays the title on the page C Adds a tooltip D Defines the title of the document, shown in the browser tab
Show answer & explanation

Defines the title of the document, shown in the browser tab

The element sets the document's title, which appears in the browser tab and is used for bookmarks.

Q9. Which of the following is a valid HTML tag for a top-level heading?

Beginner
A <h0> B <heading> C <h1> D <head>
Show answer & explanation

<h1>

is the highest-level heading tag, used for the main heading of a page.

Q10. What is the correct way to specify a paragraph in HTML?

Beginner
A <par>Text</par> B <para>Text</para> C <text>Text</text> D <p>Text</p>
Show answer & explanation

<p>Text</p>

The tag is used to define a paragraph.

Q11. The <div> element is a semantic element that provides meaning to its content.

Beginner
A True B False
Show answer & explanation

False

is a generic container with no semantic meaning; it is used for styling or layout purposes.

Building up · 8 questions

Q12. Which element is used to define the main content area of a webpage, which should be unique to the page?

Intermediate
A <article> B <main> C <div> D <section>
Show answer & explanation

<main>

is used for the primary content of the page, and it should not appear more than once per document.

Q13. What does the <nav> element represent?

Intermediate
A A block of text B A section of navigation links C A list of items D A sidebar
Show answer & explanation

A section of navigation links

is a semantic element intended for major navigation blocks, such as menus.

Q14. Which attribute is used to specify the character encoding for an HTML document?

Intermediate
A meta B charset C lang D encoding
Show answer & explanation

charset

The tag with the charset attribute, like , specifies the document's character encoding.

Q15. Which of the following is NOT a semantic element?

Intermediate
A <section> B <header> C <footer> D <div>
Show answer & explanation

<div>

is a generic container with no semantic meaning, unlike the others which convey structural meaning.

Q16. Which element is used to define a self-contained piece of content that could be distributed independently, like a blog post?

Intermediate
A <aside> B <div> C <article> D <section>
Show answer & explanation

<article>

is meant for content that is independently distributable or reusable, such as a forum post or article.

Q17. What does the <aside> element typically contain?

Intermediate
A Main content of the page B Content tangentially related to the main content C Navigation links D The document's title
Show answer & explanation

Content tangentially related to the main content

is used for content that is indirectly related to the main content, like sidebars or pull quotes.

Q18. Which element is used to define a section of a document, such as a chapter or a group of related content?

Intermediate
A <section> B <p> C <span> D <div>
Show answer & explanation

<section>

is a semantic element that groups related content, typically with a heading.

Q19. The <header> element can be used multiple times in a single HTML document.

Intermediate
A True B False
Show answer & explanation

True

The element can be used for the page header as well as for section or article headers, so it can appear multiple times.

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Exam prep

Get Veda free See what students get

Free to start · No ads · Works in 42 languages