with Answer Explanations (2026/2027)
SECTION 1: HTML5 Fundamentals and Structure
Question 1
Which HTML5 element is used to define the primary navigation links for a document?
A. <navigation>
B. <nav>
C. <menu>
D. <linkbar>
Correct Answer: B
Rationale: The <nav> element is the W3C standard semantic element for defining
navigation links. <navigation> is not a valid HTML5 element, <menu> is an
experimental element with different semantic intent, and <linkbar> does not exist.
Question 2
What is the primary purpose of the HTML5 <article> element?
A. To display a blog post or news article only
B. To define a self-contained, independently distributable piece of content
C. To wrap the main content of a page
D. To create a sidebar for related content
Correct Answer: B
,Rationale: The <article> element represents a self-contained composition that could
be independently distributed or reused, such as a forum post, magazine article, or blog
entry. It is not limited to blog posts, nor does it replace <main> or <aside>.
Question 3
Which of the following is the correct HTML5 DOCTYPE declaration?
A. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML5//EN">
B. <!DOCTYPE html5>
C. <!DOCTYPE html>
D. <!DOCTYPE HTML SYSTEM "about:legacy-compat">
Correct Answer: C
Rationale: The HTML5 DOCTYPE is simply <!DOCTYPE html>, designed to trigger
standards mode in all browsers. The other options are either legacy XHTML syntax,
invalid syntax, or unnecessary alternatives.
Question 4
A developer needs to mark up a photograph with an accompanying caption. Which
HTML5 structure is most semantically appropriate?
A. <div class="image"><img src="photo.jpg"><p>Caption</p></div>
B. <figure><img
src="photo.jpg"><figcaption>Caption</figcaption></figure>
C. <article><img
src="photo.jpg"><footer>Caption</footer></article>
D. <section><img
src="photo.jpg"><summary>Caption</summary></section>
Correct Answer: B
, Rationale: The <figure> and <figcaption> elements are specifically designed for
self-contained content like images with captions. While <div> works structurally, it
lacks semantic meaning, and the other options misuse elements for incorrect purposes.
Question 5
Which HTML5 element is used to create a collapsible content disclosure widget without
JavaScript?
A. <collapse>
B. <details> with <summary>
C. <accordion>
D. <toggle>
Correct Answer: B
Rationale: The <details> element creates a disclosure widget, and the <summary>
element provides its visible heading. The other options are not valid HTML5 elements.
Question 6
In the web development trifecta, which technology is responsible for behavior and
interactivity?
A. HTML5
B. CSS3
C. JavaScript
D. PHP
Correct Answer: C
Rationale: JavaScript handles behavior and interactivity. HTML5 provides structure and
content, CSS3 provides presentation and styling, and PHP is a server-side language not
part of the client-side trifecta.
Question 7