2026/2027 | 100% Correct Answers with Complete Solutions |
HTML5, CSS3, JavaScript, Responsive Design | Pass
Guaranteed - A+ Graded
Domain 1: HTML5 & Semantic Markup (15 Questions)
Q1: A web developer is creating a blog article page. The content includes a main article,
a sidebar with related links, and a footer with copyright information. Which HTML5
structure uses semantic elements correctly to maximize accessibility and SEO?
A. <div id="main"> for article, <div id="sidebar"> for links, <div
id="footer"> for copyright
B. <article> for main content, <aside> for sidebar, <div class="bottom"> for
footer
C. <section> for article, <div> for sidebar, <footer> for copyright
D. <main> for article content, <aside> for related links sidebar, <footer> for
copyright information [CORRECT]
Correct Answer: D
,Rationale: Option D correctly implements HTML5 semantic elements. The <main>
element represents the dominant content of the document (unique to that document),
<aside> marks tangentially related content (perfect for sidebars), and <footer>
defines footer content. Option A fails entirely by using only generic <div> elements
with IDs, providing no semantic meaning to assistive technologies or search engines.
Option B incorrectly uses <article> without proper context—while <article> could
work, it's less appropriate than <main> for the primary content area, and using <div>
for footer misses semantic opportunities. Option C uses <section> which is too
generic for main content (lacks the "main content" semantic that <main> provides) and
fails to use semantic elements for the sidebar. WCAG 2.1 guidelines emphasize proper
landmark regions, which these semantic elements provide.
Q2: A developer needs to embed a video with multiple source formats (MP4, WebM,
Ogg) to ensure cross-browser compatibility, provide fallback content for unsupported
browsers, and include captions for accessibility. Which code snippet meets all these
requirements?
A. <video src="movie.mp4" controls><p>Your browser doesn't support
video</p></video>
B. <video controls><source src="movie.mp4"
type="video/mp4"><source src="movie.webm"
type="video/webm"><track kind="captions" src="captions.vtt"
,srclang="en" label="English">Your browser doesn't support
video</video> [CORRECT]
C. <video controls><source src="movie.mp4"><source
src="movie.webm"><track src="captions.vtt"></video>
D. <video><source src="movie.mp4" type="video/mp4"><source
src="movie.ogg" type="video/ogg"><p>Fallback</p></video>
Correct Answer: B
Rationale: Option B is correct because it includes multiple <source> elements with
proper MIME types (enabling browser selection of supported formats), a <track>
element with complete attributes (kind="captions" for accessibility, srclang for
language specification, label for user selection), and fallback text content. Option A
fails because it only provides one video format (no cross-browser compatibility) and
lacks caption support. Option C is incorrect because it omits required type attributes
on sources (reducing browser efficiency in format selection), lacks kind attribute on
track (defaults to subtitles, not captions), and omits srclang and label which are
required for valid caption tracks. Option D lacks the controls attribute (making video
unplayable without JavaScript), omits caption support entirely, and uses generic
fallback without semantic structure.
, Q3: When creating an HTML5 form for user registration, which input type and attribute
combination provides the best user experience for entering a birth date while ensuring
proper data validation?
A. <input type="text" name="birthdate" placeholder="MM/DD/YYYY">
B. <input type="date" name="birthdate" required min="1900-01-01"
max="2024-12-31"> [CORRECT]
C. <input type="datetime" name="birthdate" required>
D. <input type="text" name="birthdate" pattern="\d{2}/\d{2}/\d{4}"
required>
Correct Answer: B
Rationale: Option B uses type="date" which provides native browser date pickers,
mobile-optimized keyboards, and built-in validation. The min and max attributes
constrain realistic date ranges (preventing future dates or impossibly old entries), while
required ensures data completeness. Option A relies on text input with placeholder
guidance—users can enter invalid formats, no validation occurs, and mobile users get
standard keyboards instead of date pickers. Option C uses type="datetime" which is
deprecated in HTML5 (removed from specification) and unnecessarily includes time
components for a birth date. Option D uses pattern validation on text input, which is
better than A but inferior to native date inputs—patterns are harder to maintain, provide