🌍 freeCodeCamp · flashcards

freeCodeCamp Responsive Web Design Flashcards

50 question-and-answer cards covering Responsive Web Design as it is examined in freeCodeCamp. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.

50Cards in deck
24Free preview
22Syllabus topics
~225Chars per answer
FreePrice

24 sample cards from the Responsive Web Design deck

Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.

  1. What is the classic CSS technique to horizontally center a block element?

    Give it a defined width (or max-width) and set margin: 0 auto; — the auto left and right margins split the remaining space equally.

  2. What are the syntaxes for defining colors in CSS with rgb, hsl, and hex, including alpha?

    Hex: #RRGGBB (or #RRGGBBAA with alpha), each channel 00–FF. rgb(r, g, b) with each channel $0\text{–}255$, or rgba(r, g, b, a) with $a \in [0, 1]$. hsl(h, s%, l%) with hue $h \in [0^{\circ}, 360^{\circ}]$, saturation and lightness as percentages; hsla adds alpha.

  3. In the HSL color model, what do hue values of $0^{\circ}$, $120^{\circ}$, and $240^{\circ}$ represent, and what do 100% and 50% lightness give?

    $0^{\circ}$ = red, $120^{\circ}$ = green, $240^{\circ}$ = blue on the color wheel. Lightness 100% is white, 0% is black, and 50% is the pure hue.

  4. What is the difference between linear-gradient and radial-gradient in CSS?

    linear-gradient(direction, color1, color2, ...) transitions colors along a straight line (e.g., 90deg or to right); radial-gradient radiates colors outward from a center point in a circular or elliptical shape. Both are used as background-image values.

  5. What do background-size: cover and background-size: contain do?

    cover scales the background image to completely fill the container (cropping overflow if aspect ratios differ); contain scales it so the whole image fits inside the container (possibly leaving empty space).

  6. What is a font stack in the CSS font-family property and why include a generic family last?

    A comma-separated list of fonts, e.g., font-family: "Open Sans", Arial, sans-serif;. The browser uses the first available font; the generic family (serif, sans-serif, monospace) at the end guarantees a fallback if none of the named fonts load.

  7. What is the difference between serif and sans-serif typefaces?

    Serif fonts have small decorative strokes (serifs) at the ends of letterforms (e.g., Times New Roman), traditionally used for print body text; sans-serif fonts lack these strokes (e.g., Arial, Helvetica) and are common for screen text.

  8. In typography CSS, what do line-height, letter-spacing, and text-transform control?

    line-height sets the vertical space of each line of text (commonly a unitless multiplier like 1.5 of the font size); letter-spacing adjusts space between characters; text-transform changes casing (uppercase, lowercase, capitalize) without altering the HTML.

  9. What does display: flex do, and along which two axes does a flex container operate?

    It turns an element into a flex container whose direct children become flex items laid out along the main axis (set by flex-direction: row, row-reverse, column, or column-reverse) and the perpendicular cross axis.

  10. In Flexbox, what do justify-content and align-items control?

    justify-content distributes items along the main axis (flex-start, center, space-between, space-around, space-evenly); align-items aligns items along the cross axis (stretch, flex-start, center, baseline).

  11. What does flex-wrap do, and what is the shorthand that combines it with flex-direction?

    flex-wrap: wrap allows flex items to break onto multiple lines when they overflow (default nowrap keeps one line). flex-flow is the shorthand: flex-flow: <direction> <wrap>, e.g., flex-flow: row wrap.

  12. What three properties does the flex shorthand on a flex item combine, and what does each do?

    flex: <grow> <shrink> <basis>. flex-grow sets the proportion of extra space the item takes; flex-shrink sets how much it shrinks when space is short; flex-basis sets its initial main-axis size before growing/shrinking. flex: 1 equals 1 1 0.

  13. How do the order and align-self properties affect an individual flex item?

    order changes the visual position of an item relative to siblings (default 0; lower values come first) without changing the HTML. align-self overrides the container's align-items for that single item on the cross axis.

  14. How can Flexbox perfectly center an element both horizontally and vertically?

    On the parent: display: flex; justify-content: center; align-items: center; — centering on the main and cross axes simultaneously.

  15. How do you define a CSS Grid with 3 equal-width columns, and what does the fr unit mean?

    display: grid; grid-template-columns: 1fr 1fr 1fr; (or repeat(3, 1fr)). The fr unit is a fraction of the free space in the grid container — 1fr 2fr gives the second track twice the free space of the first. gap (or row-gap/column-gap) sets spacing between tracks.

  16. In CSS Grid, how do you place an item to span from column line 1 to column line 3?

    grid-column: 1 / 3; (start line / end line) — spanning 2 tracks. Equivalently grid-column: 1 / span 2. grid-row works the same way for rows; note lines are numbered from 1, and an $n$-column grid has $n+1$ vertical lines.

  17. What do grid-template-areas and the grid-area property let you do?

    grid-template-areas defines a named visual map of the layout using strings (e.g., "header header" "sidebar main"), and each item is assigned with grid-area: header; — placing items by name instead of line numbers. A . denotes an empty cell.

  18. What does grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) achieve?

    A responsive grid without media queries: the browser creates as many columns as fit, each at least 200px and growing up to 1fr to share leftover space. auto-fit is similar but collapses empty tracks so existing items stretch to fill the row.

  19. What is the syntax of a CSS media query that applies styles only on screens 768px wide or narrower, and what is mobile-first design?

    @media (max-width: 768px) { ... }. Mobile-first design writes base styles for small screens and uses @media (min-width: ...) queries to progressively add styles for larger screens (the breakpoints).

  20. Contrast the relative units em and rem in CSS.

    1em equals the font size of the element's parent (for font-size) or the element itself (for other properties), so em values compound when nested. 1rem always equals the root (<html>) font size — by default $1\,\mathrm{rem} = 16\,\mathrm{px}$ — making rem predictable for consistent scaling.

  21. What do the viewport units vw, vh, vmin, and vmax represent?

    1vw $= 1\%$ of the viewport width; 1vh $= 1\%$ of the viewport height; 1vmin $= 1\%$ of the smaller viewport dimension; 1vmax $= 1\%$ of the larger. So an element with width: 50vw always spans half the viewport width.

  22. What CSS rule makes an image responsive so it scales down with its container but never overflows?

    img { max-width: 100%; height: auto; } — the image shrinks to fit narrow containers while height: auto preserves its aspect ratio, and it never renders larger than its natural size.

  23. What do the srcset attribute and the <picture> element provide for responsive images?

    srcset (with sizes) lists multiple resolutions of the same image so the browser downloads the size appropriate for the display — resolution switching. <picture> with <source media="..."> serves different images per condition (art direction), falling back to the inner <img>.

  24. In the freeCodeCamp Survey Form project, which required form controls must be present and how are they identified?

    A text input (#name), an email input with validation (#email), a number input with min and max (#number), a <select> dropdown (#dropdown), at least two radio buttons sharing a name, at least three checkboxes with value attributes, a <textarea>, and a submit button (#submit), under an <h1 id="title"> and <p id="description">, all inside one <form>.

What this deck covers

The Responsive Web Design deck follows the freeCodeCamp Responsive Web Design syllabus — 6 chapters and 22 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 8.3 cards per chapter.

Answers are written to be recallable, not just readable — averaging about 225 characters, which is long enough to carry the reasoning and short enough to say out loud.

A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.

Responsive Web Design flashcards FAQ

How many Responsive Web Design flashcards are in this freeCodeCamp deck?

50 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.

Are these freeCodeCamp flashcards free?

Yes. The preview here is free to read with no signup, and the full 50-card deck is free inside the Examius app.

What do the Responsive Web Design cards cover?

They follow the freeCodeCamp Responsive Web Design syllabus — 6 chapters and 22 topics — so the questions track what is actually examinable.

How should I use these flashcards?

Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.