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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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?
BeginnerShow 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.
BeginnerShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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?
IntermediateShow 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.
IntermediateShow 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.
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