· 3 min read

CSS Box Model, Selectors and Media Queries: A Flashcard Study Guide

Master the CSS box model, positioning, Flexbox, Grid, 40+ selectors and pseudo-classes, specificity, media queries and animations with 129 real flashcards from deck UZ5568.

Laptop and phone screens with nested colored box layers, curly brace and paintbrush surrounded by floating flashcards

Studying. But it's also a video game. 🎮

Flashcards, quizzes and games that make you actually remember.

Start playing — it's free

Posted by

CSS is easy to read and surprisingly hard to recall: you know position: absolute exists, but is it relative to the viewport or the nearest positioned ancestor? Which is stronger, an ID or ten classes? Does em follow the parent or the root? The CSS: Box Model, Selectors & Media Queries deck on Flip It (code UZ5568, 129 cards) turns those questions into flashcards so the answers arrive before you reach for MDN. Here is how to study it.

Study this deck: CSS: Box Model, Selectors & Media Queries

1 / 10
Question

CSS

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Sample cards

FrontBack
Box-sizing: border-boxMakes width and height include padding and border, not just content
Margin collapseWhen vertical margins of adjacent block elements combine into a single margin (the larger of the two)
Position: absolutePositions the element relative to its nearest positioned ancestor; removed from document flow
Flex: 1Shorthand for flex-grow: 1, flex-shrink: 1, flex-basis: 0%
Adjacent sibling combinator+ (e.g., h1 + p selects p immediately after h1)
Specificity order (from highest to lowest)Inline styles > IDs > Classes/attributes/pseudo-classes > Elements/pseudo-elements
:where()Like :is() but with zero specificity. Useful for default styles that should be easily overridden
em vs remem is relative to the parent's font-size; rem is relative to the root (html) font-size
Min-width in media queriesApplies styles when viewport is at or above specified width. @media (min-width: 768px) = desktop-first breakpoint
Animation-fill-modeHow styles are applied before/after animation: none, forwards (keep end state), backwards (apply start), both

Everything the 129 cards cover

  • Box model & layout — content/padding/border/margin, box-sizing, margin collapse, shorthand order (top-right-bottom-left), display block/inline/inline-block/none vs visibility: hidden, position static/relative/absolute/fixed/sticky, z-index, overflow hidden/scroll/auto, max-width, min-height.
  • Flexbox & Grid — flex-direction, justify-content, align-items, flex-wrap, flex: 1, grid-template-columns/rows, the fr unit, gap, grid-column: span 2.
  • Selectors — type, class, ID, universal, [attr], [attr="value"]; descendant, child >, adjacent +, general sibling ~ combinators; pseudo-classes :hover, :active, :focus, :visited, :first-child, :last-child, :nth-child(n), :nth-of-type(n), :not(), :is(), :has(), :where(), :empty, :checked, :disabled, :enabled, :required, :valid/:invalid; pseudo-elements ::before, ::after, ::first-letter, ::first-line, ::selection, ::placeholder.
  • Cascade — specificity, !important, the cascade algorithm.
  • Typography & color — font-size, font-family, font-weight, text-align, text-decoration, line-height, letter-spacing, text-transform, white-space: nowrap, rgba(), opacity, border shorthand, border-radius, box-shadow, cursor: pointer.
  • Units — em, rem (1rem ≈ 16px), vh, vw.
  • Media queries — syntax, max-width vs min-width, combining with and/commas, common breakpoints, the viewport meta tag.
  • Motion — transition shorthand and timing functions, what can and cannot be transitioned, animation shorthand, @keyframes, iteration-count, direction, fill-mode, play-state, transform translate/rotate/scale/skew, transform-origin, will-change.

Two tips for this deck

Turn the combinator and pseudo-class cards into a scratch file. About 40 cards are selectors. Each time one comes up, type its example (h1 ~ p, li:nth-child(odd), div:has(img)) into a CodePen with three or four elements and watch what turns red. The deck's backs already contain runnable snippets, so the cost is thirty seconds per card, and a selector you've seen match is far stickier than one you've read.

Learn the "pairs" cards together. The deck is full of near-twins that cause real bugs: display: none vs visibility: hidden, em vs rem, max-width vs min-width media queries, :nth-child vs :nth-of-type, :is() vs :where(), transition vs animation. When one twin appears in review, say the other one's answer too. That converts a confusable pair into a single, stable contrast.

Where to find it

Sign in to Flip It and open UZ5568 — CSS: Box Model, Selectors & Media Queries. At roughly 20 new cards a day the deck takes a week to seed, after which daily reviews shrink to a few minutes — cheaper than looking up flex-basis for the fifth time.

Ready to learn faster? 🚀

Join FLIP IT for free and turn studying into a game.

Create my free account