WGU C777 Web Development OA
Test Bank 2025-2026 | 350+ Questions
with Verified Answers | WGU
Objective Assessment Aligned | Pass
Guarantee
PART A – 250 Multiple-Choice (Vertical Options)
Directions: Choose the BEST answer. Each option is listed vertically as required.
1. Which HTML5 element is the MOST semantic container for a self-contained
composition that could be syndicated?
A. <section>
B. <article>
C. <div>
D. <main>
Answer: B
Rationale: Per W3C HTML5 spec §4.3.3, <article> represents "a complete, or self-
contained, composition."
2. Which attribute improves accessibility by providing an accessible name to an icon
button that shows only an SVG?
A. aria-label
B. alt
C. title
D. role="presentation"
Answer: A
Rationale: aria-label gives the accessible name when text content is absent
(WCAG 2.2 Technique ARIA6).
3. Which CSS unit is ALWAYS relative to the parent element’s font-size?
A. rem
B. em
C. vh
D. px
Answer: B
Rationale: 1em = parent’s computed font-size; rem is root-relative.
4. The prefers-reduced-motion media query is used to:
A. decrease file size
B. respect user accessibility settings ✅
, 2
C. enable GPU rasterization
D. force 60 FPS
Answer: B
Rationale: WCAG 2.2 Success-Criterion 2.3.3 (Animation from Interactions).
5. Which value of display creates a block-level flex container?
A. flex
B. inline-flex
C. block
D. grid
Answer: A
Rationale: display:flex generates block flexbox per CSS Display Module.
6. In Flexbox, which property shrinks an item proportionally when space is
deficient?
A. flex-grow
B. flex-shrink ✅
C. flex-basis
D. order
Answer: B
Rationale: flex-shrink coefficient controls negative-space distribution.
7. Which CSS feature creates a responsive 12-column layout WITHOUT media
queries?
A. repeat(12, 1fr) grid
B. auto-fit + minmax() ✅
C. float:left
D. table-layout:fixed
Answer: B
Rationale: grid-template-columns:repeat(auto-fit,minmax(250px,1fr)) is fluid.
8. Which pseudo-element targets the first line inside a block?
A. :first-letter
B. :first-line ✅
C. ::before
D. :nth-line(1)
Answer: B
Rationale: CSS Pseudo-Elements Module defines ::first-line.
9. Which at-rule introduces a font file for @font-face?
A. @import
B. @font-face ✅
C. @keyframes
D. @media
Answer: B
Rationale: W3C CSS Fonts Module.
, 3
10. The defer attribute on an external <script> ensures:
A. execution after HTML parsing ✅
B. asynchronous download & immediate exec
C. blocking render
D. module loading
Answer: A
Rationale: defer maintains order and fires after DOMContentLoaded.
11. Which DOM method returns a LIVE NodeList?
A. querySelectorAll()
B. getElementsByClassName() ✅
C. Array.from()
D. matches()
Answer: B
Rationale: HTMLCollection/NodeList from getElementsBy* is live.
12. const arr = [1, 2, 3]; arr.push(4); What is arr.length?
A. 3
B. 4 ✅
C. Error
D. undefined
Answer: B
Rationale: const prevents reassignment, NOT mutation.
13. Which array method creates a new array with elements that pass a test?
A. map()
B. filter() ✅
C. forEach()
D. reduce()
Answer: B
Rationale: filter returns shallow copy of matches.
14. The event object property that contains the deepest element that triggered the
event is:
A. event.currentTarget
B. event.target ✅
C. event.delegate
D. event.srcElement (deprecated)
Answer: B
Rationale: target is the originator; currentTarget is the bound element.
15. Which statement is TRUE about localStorage?
A. synchronous ✅
B. transmits to server automatically
C. 10 MB limit in all browsers
D. expires on tab close
, 4
Answer: A
Rationale: localStorage is a synchronous API; 5-10 MB varies; persists.
16. Which status code indicates "Created" after a POST request?
A. 200
B. 201 ✅
C. 204
D. 304
Answer: B
Rationale: RFC 7231 §6.3.2.
17. Which Fetch API option sets custom headers?
A. headers ✅
B. body
C. mode
D. cache
Answer: A
Rationale: new Headers({}) passed in init.
18. Which directive upgrades insecure HTTP requests in CSP?
A. default-src
B. upgrade-insecure-requests ✅
C. block-all-mixed-content
D. require-sri-for
Answer: B
Rationale: W3C CSP Level 3.
19. Which HTTP header forces HTTPS for one year including subdomains?
A. Strict-Transport-Security: max-age=31536000; includeSubDomains ✅
B. X-Content-Type-Options
C. X-Frame-Options
D. Referrer-Policy
Answer: A
Rationale: RFC 6797 HSTS.
20. Which vulnerability arises from injecting untrusted data into HTML without
encoding?
A. XSS ✅
B. CSRF
C. DOS
D. SQLi
Answer: A
Rationale: Cross-Site Scripting OWASP Top 10 2021.
21. Which attribute makes a cookie inaccessible to JavaScript?
A. Secure
B. HttpOnly ✅
C. SameSite