Exam Information
Free practice questions with explanations
WGU Web-Development-Foundation Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 14
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice CSS Styling and Layout
A product team maintains a marketing site where a shared stylesheet defines a card component with a fixed width of 320px and a fixed height of 240px. Content editors report that long product descriptions overflow the bottom edge of the cards and overlap the card beneath them. The cards must keep a uniform visual grid on desktop, and the team cannot alter the HTML markup generated by the content management system. Which change is the BEST fix within these constraints?
Correct Answer: BExplanationA fixed height is the root cause, since content that exceeds it spills outside the box. Switching to min-height lets the card expand to fit its text while keeping the width-based grid, and it requires no markup changes. Overflow hidden hides the descriptions, which loses required content. Absolute positioning removes the card from normal flow and breaks the grid. A z-index value only controls stacking order and does nothing to stop the text from spilling out of the box.
-
2 Question 2 Single choice CSS Styling and Layout
A front-end engineer is building a page header whose navigation items must sit on one horizontal row, be evenly spaced across the full container width, and wrap gracefully onto a second row only if the viewport becomes too narrow. The engineer must avoid floats and avoid calculating pixel widths for each item because the number of links changes frequently. Which declaration set on the navigation container meets these requirements?
Correct Answer: DExplanationA flex container with flex-wrap set to wrap lays items out on one row when space allows and moves overflow items to a new line, while justify-content: space-between distributes the items evenly across the full width without any per-item pixel calculations. A fixed-width float layout violates the no-floats constraint and does not adapt to a changing item count. A fixed 120px grid column does not spread items across the container. The nowrap setting prevents the required wrapping behaviour, and centering does not distribute the items evenly.
-
3 Question 3 Single choice CSS Styling and Layout
A design system defines a brand color in a custom property on the root element. A legacy widget on a corporate intranet page sets its own color using an inline style attribute, and the team wants the widget's text to follow the brand color whenever the root value changes, without editing the widget markup. A stylesheet rule later in the cascade targets the same element with a more specific selector, but the widget's inline style must still be overridden only in one specific context. The team has asked for the smallest change that keeps the design token as the single source of truth. What should the engineer do?
Correct Answer: AExplanationInline styles have the highest specificity in ordinary declarations, so the cleanest route is to move the color out of the attribute and into a stylesheet rule that references the custom property, keeping the token authoritative. Adding !important everywhere is a blunt tool that creates maintenance problems and still leaves hard-coded values in play. Hard-coding the hex value duplicates the token and will drift when the root value changes. Rewriting styles with JavaScript at runtime adds complexity and a flash of incorrect styling, which is unnecessary when a stylesheet rule can do the job.
-
4 Question 4 Single choice HTML Structure and Implementation
A content team is publishing a long technical article with a main body, a sidebar of related links, a site-wide footer, and several self-contained figures with captions. The developer must use HTML elements that describe the document's structure to assistive technologies and search engines, rather than relying on generic container elements with class names. Which markup arrangement is the MOST appropriate?
Correct Answer: AExplanationThe main, aside, footer, and figure elements carry built-in meaning that browsers expose to assistive technology and that search engines use to interpret page structure, so using them is the semantic choice. Class-named div elements convey no meaning to machines beyond what the class name implies to a human. Span elements are inline and generic and offer no structural semantics. A single section wrapping everything with header elements does not identify the main content or the complementary sidebar, which weakens navigation for assistive tools.
-
5 Question 5 Single choice HTML Structure and Implementation
A developer receives a page whose form fields have visible labels, but screen reader users report they cannot tell which label belongs to which input. The labels are written as plain paragraphs placed immediately above each input, with no for attribute and the inputs are not wrapped by their labels. The developer must fix the markup without changing the visual layout or introducing JavaScript. Which change is correct?
Correct Answer: BExplanationA label element associated with its input through a matching for and id pair gives assistive technology the programmatic relationship it needs, and it works without scripting and without changing the visible layout. Hiding a div from assistive technology removes the text rather than associating it. A title attribute is a weaker fallback and is not the primary association method. Removing the visible label in favour of a placeholder causes the placeholder to disappear once the user types and fails usability guidance for visible labels.
-
6 Question 6 Multiple choice HTML Structure and Implementation
A small development team is reviewing a product listing page that renders a grid of items. Each item has an image, a heading, and a price. The page must be valid HTML, and the reviewers want the markup to communicate the grouping of items and the relationship between each image and its description to browsers and assistive technologies. Which TWO practices best meet these requirements? (Choose two.)
Correct Answer: B, CExplanationA list of items communicates a set of related entries, and each item in a li is exposed as part of that list, which fits a product grid. Figure with figcaption ties an image to its descriptive text in a machine-readable way. A table misrepresents a layout grid as tabular data. Wrapping headings in buttons changes their meaning and is not an appropriate way to make items keyboard accessible. Nesting a p inside a p is invalid HTML, since paragraphs cannot contain other paragraphs.
-
7 Question 7 Single choice Web Design and Development Fundamentals
A nonprofit's website is slow on mobile connections, and an audit shows that the homepage loads a 2 MB hero image that is displayed at 400 pixels wide on phones. The team must keep the same visual design on desktop, where the image is shown at 1200 pixels wide, and they have no budget for a new image hosting service. Which approach is the BEST first step?
Correct Answer: BExplanationResponsive images using srcset with a sizes attribute let the browser choose a file whose resolution matches the display width, so phones download a smaller file while desktops still receive the full-size image, all without new hosting. Serving one large image forces every device to download 2 MB. Moving the image to a CSS background does not reduce its file size and changes how it loads without solving the cost. Removing the image abandons the required visual design.
-
8 Question 8 Single choice Web Design and Development Fundamentals
A web developer is building a responsive page that must work on phones, tablets, and desktops. The developer has set the layout width with fixed pixel values, and on a phone the page appears zoomed out, with text too small to read without pinching. The site must scale correctly with no separate mobile site. Which element should be added to the document head, and why?
Correct Answer: AExplanationWithout a viewport meta tag, mobile browsers render the page at a default desktop-width layout and scale it down, which is why text looks tiny. Setting width=device-width with initial-scale=1 makes the layout viewport follow the device width, which is the standard responsive baseline. Font stylesheets do not change how the viewport is sized. A robots meta element controls crawling and indexing, not rendering. Scripting the width on load is fragile and does not replace the declared viewport.
-
9 Question 9 Single choice Web Design and Development Fundamentals
A team is designing a checkout page for an online store. Usability testing shows that customers frequently abandon the form because the error messages appear only after the entire form is submitted and do not identify which field failed. The team wants a fix that follows accepted design practice, works for keyboard and screen reader users, and does not require adding a third-party library. Which design decision is the BEST choice?
Correct Answer: DExplanationInline validation that triggers when a field loses focus gives immediate, specific feedback, and linking each message to its input with aria-describedby lets screen reader users hear the error in context. A generic top-of-page message leaves users searching for the faulty field. Coloring every field red at load communicates errors that have not occurred and creates noise. Removing validation pushes the cost onto staff and produces bad data.
-
10 Question 10 Multiple choice Web Design and Development Fundamentals
A developer is preparing a landing page for a public service agency that must meet WCAG 2.1 AA contrast guidance for its text. The brand palette includes a light grey background and several text colors. Which TWO actions best ensure that body text remains readable for users with low vision? (Choose two.)
Correct Answer: B, EExplanationWCAG 2.1 AA requires a contrast ratio of at least 4.5 to 1 for normal body text, so checking the palette against that threshold directly addresses readability. Supporting text resizing with legible base sizes ensures that users who enlarge text keep a usable layout. Relying on color alone violates the requirement that information not depend solely on color. Pale grey on white usually fails the contrast threshold. Text over a busy photograph without an overlay produces unpredictable contrast and fails the same requirement.
-
11 Question 11 Single choice CSS Styling and Layout
A front-end engineer maintains a stylesheet in which a generic selector for .btn sets background-color to blue, and a later rule for .btn.primary sets background-color to green. A new component uses the class btn on a button and the class primary on a link element, not a button, and the link displays blue instead of green. The engineer confirms the link's markup is correct and that the primary rule is present in the file. Which explanation accounts for the blue appearance?
Correct Answer: AExplanationThe compound selector .btn.primary matches only elements that carry both classes, so a link with just the primary class never matches it and falls back to the generic .btn rule, which the markup must also include for the green style to apply. The claim that class selectors are ignored on anchors is false. Rule order would only matter if both rules matched the same element with equal specificity, and here the green rule does not match at all. Browsers fully support compound selectors, so the rule is not discarded.
-
12 Question 12 Single choice HTML Structure and Implementation
A web team is building a page that displays a data table of quarterly sales figures by region and by product line. Reviewers flag that the current table has no header cells and uses bold text in the first row to indicate column names. The team must make the table understandable to screen reader users, who navigate by row and column headers. Which markup change is the MOST correct?
Correct Answer: CExplanationHeader cells built with th, with scope identifying whether each header applies to a column or a row, let assistive technology announce the correct header as users move through the data. Styling a td or wrapping text in strong adds visual emphasis but exposes no header relationship to the parser. Converting tabular data into divs destroys the row and column association that makes the data meaningful.
-
13 Question 13 Single choice Web Design and Development Fundamentals
A development team is planning a multi-page marketing site. The client asks for every page to share the same navigation bar, footer, and color scheme, and wants a change to the brand color to take effect across all pages after a single edit. The team has no server-side templating system and is deploying static HTML files. Which approach best meets these requirements?
Correct Answer: DExplanationAn external stylesheet linked from every page, with the brand color defined once as a custom property, means a single edit updates the entire site, and it works on static hosting without any build step. Copying markup and values into each page creates many places that must change together. Inheritance from the home page's body does not carry across separate documents. Loading shared markup from another page at runtime is not a supported mechanism and breaks when the home page changes.
-
14 Question 14 Multiple choice CSS Styling and Layout
A front-end developer is reviewing a stylesheet for a responsive article page that must keep its text readable on screens from 320 pixels to 1440 pixels wide. The reviewers note that long lines of text are hard to read on desktop and that fixed font sizes do not respond to user preferences. Which TWO changes best address these issues? (Choose two.)
Correct Answer: B, CExplanationConstraining the container with a maximum measured in ch keeps line length in a comfortable reading range regardless of screen width. Defining font size in rem ties the text to the root font size, so it respects the user's browser text settings. Fixed pixel fonts ignore those preferences. Removing line-height usually reduces readability. An unbounded full-width container produces the very long lines the reviewers want to avoid.
These are 14 of the 77 questions in the full Web-Development-Foundation pack.
Get All 77 QuestionsGet all 77 questions & answers
Full access options for WGU Web-Development-Foundation
Self-study
PDF Version
- 77 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 77 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 77 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the Web-Development-Foundation Exam (WGU Web Development Foundations) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.