Exam Preparation
Complete Questions and Correct Detailed Answers
Verified Answers | Already Graded A+
Version A & Version B | 200 Total Questions
Aligned with 2026-2027 WGU C777 Curriculum Standards
Front-End Web Development Competencies
Six Core Content Areas: HTML5 Structure & Semantics | CSS3 Styling & Layout | JavaScript & DOM | Forms
& Validation | Mobile Design & Accessibility | Integrated Scenarios
,WGU C777 Objective Assessment Exam Preparation 2026-2027 Curriculum
Table of Contents
VERSION A - 100 Questions 3
Section 1: HTML5 Structure, Semantics, and APIs 3
Section 2: CSS3 Styling, Layout, and Responsive Design 11
Section 3: JavaScript Programming and DOM Manipulation 18
Section 4: Forms, Validation, and User Input 21
Section 5: Mobile Web Design and Accessibility 24
Section 6: Integrated Web Development Scenarios 26
VERSION B - 100 Questions 28
Section 1: HTML5 Structure, Semantics, and APIs 28
Section 2: CSS3 Styling, Layout, and Responsive Design 36
Section 3: JavaScript Programming and DOM Manipulation 42
Section 4: Forms, Validation, and User Input 46
Section 5: Mobile Web Design and Accessibility 48
Section 6: Integrated Web Development Scenarios 50
2
,WGU C777 Objective Assessment Exam Preparation 2026-2027 Curriculum
VERSION A - 100 Questions
Section 1: HTML5 Structure, Semantics, and APIs
Questions 1 - 35
Q1: A developer is building a webpage and needs to declare the document type. Which DOCTYPE declaration
should be used to ensure the browser renders the page in standards mode using HTML5 rules?
A. <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN'>
B. <!DOCTYPE html> [CORRECT]
C. <html xmlns='http://www.w3.org/1999/xhtml'>
D. <!DOCTYPE XHTML 1.0 Strict>
Correct Answer: B
Rationale: The <!DOCTYPE html> declaration tells the browser to render the page in standards mode using HTML5 rules.
Older DOCTYPE declarations such as HTML 4.01 or XHTML 1.0 are obsolete and would trigger quirks mode or a different
rendering path. The W3C recommends this simple, case-insensitive declaration as the standard for all modern web pages.
Q2: Which HTML5 element is most appropriate for containing content that is tangentially related to the main
content, such as a sidebar, pull quotes, or related news feeds?
A. <section>
B. <article>
C. <aside> [CORRECT]
D. <nav>
Correct Answer: C
Rationale: The <aside> element contains content that is tangentially related to the surrounding content, such as sidebars,
pull quotes, or supplementary information. The <section> element represents a thematic grouping of content, <article>
represents a self-contained composition, and <nav> represents navigation links. The W3C specification clearly distinguishes
<aside> as the correct semantic choice for peripheral or supplementary content.
Q3: A web developer needs to provide alternative text for an image to support screen reader accessibility.
Which attribute must be included on the <img> tag?
A. title
B. alt [CORRECT]
C. src
D. longdesc
Correct Answer: B
Rationale: The alt attribute on <img> tags provides alternative text that screen readers can read aloud to visually impaired
users, making web content accessible. The src attribute specifies the image source URL, the title attribute provides
supplementary tooltip text, and longdesc is a deprecated attribute. WCAG guidelines and W3C accessibility standards
mandate the alt attribute as essential for compliance.
Q4: What is the default size of an HTML5 canvas element when no width or height attributes are specified?
A. 150 pixels wide by 300 pixels high
3
, WGU C777 Objective Assessment Exam Preparation 2026-2027 Curriculum
B. 300 pixels wide by 150 pixels high [CORRECT]
C. 100% of the parent container width and height
D. 640 pixels wide by 480 pixels high
Correct Answer: B
Rationale: The default canvas size is 300 pixels wide by 150 pixels high unless width and height attributes are explicitly set.
This is defined in the W3C HTML5 specification. Developers must specify custom dimensions to avoid unexpected
rendering results, as the default is relatively small and may not suit most applications.
Q5: In the HTML5 Canvas API, which method must be called to begin defining a new path before drawing
shapes?
A. startPath()
B. beginPath() [CORRECT]
C. newPath()
D. initPath()
Correct Answer: B
Rationale: The beginPath() method starts a new path on the canvas, clearing any previous path definitions. After calling
beginPath(), developers use moveTo() and lineTo() to define the path, then stroke() or fill() to render it. The W3C Canvas 2D
Context specification defines beginPath() as the correct method; startPath(), newPath(), and initPath() are not valid Canvas
API methods.
Q6: A developer is using the Canvas API to render an outlined shape. Which method should be called after
defining the path to render only the outline?
A. fill()
B. render()
C. stroke() [CORRECT]
D. draw()
Correct Answer: C
Rationale: The stroke() method renders the outline of the current path using the current strokeStyle. In contrast, fill() fills
the interior of a closed path with color. The render() and draw() methods do not exist in the Canvas 2D API. The W3C
specification defines stroke() as the method to paint the path's outline, while fill() paints the interior area.
Q7: Before calling stroke() on a canvas path, which property determines the color or style of the rendered line?
A. fillStyle
B. lineColor
C. strokeStyle [CORRECT]
D. pathColor
Correct Answer: C
Rationale: The strokeStyle property determines the color, gradient, or pattern used when stroking (outlining) a path. It
must be set before calling stroke(). The fillStyle property is used for fill operations, not stroke operations. lineColor and
pathColor are not valid Canvas API properties. This distinction is fundamental to the W3C Canvas 2D Context specification.
Q8: Which HTML5 semantic element is best suited for representing a self-contained composition that could be
independently distributed or reused, such as a blog post or news article?
A. <section>
B. <div>
C. <article> [CORRECT]
D. <main>
4