🌍 Frontend Web Development · subject
Frontend Web Development CSS & Styling Syllabus
Every chapter and topic of CSS & Styling examined in Frontend Web Development — 6 chapters, 26 topics, plus 63 flashcards written against it.
CSS & Styling syllabus — full chapter and topic list
Expand any chapter to see its topics and sub-topics. This is the whole examinable outline for CSS & Styling in Frontend Web Development, not a summary of it.
-
CSS Fundamentals
5 topics- Selectors & Specificity
- The Cascade & Inheritance
- Colors, Units & Values
- Typography & Web Fonts
- Backgrounds & Borders
-
The Box Model & Layout
4 topics- Box Model & box-sizing
- Display & Positioning
- Margins, Padding & Collapsing
- Overflow & Z-index
-
Flexbox & Grid
4 topics- Flexbox Container & Items
- CSS Grid Tracks & Areas
- Gap, Alignment & Ordering
- Choosing Flexbox vs Grid
-
Responsive Design
4 topics- Mobile-First Strategy
- Media Queries & Breakpoints
- Fluid Layouts & Relative Units
- Container Queries
-
Transitions, Animations & Effects
4 topics- Transitions & Timing Functions
- Keyframe Animations
- Transforms (2D & 3D)
- Filters, Gradients & Shadows
-
Modern CSS Architecture
5 topics- Custom Properties (CSS Variables)
- Naming Conventions (BEM)
- CSS Preprocessors (Sass)
- Utility-First CSS (Tailwind)
- CSS Modules & CSS-in-JS
CSS & Styling flashcards for Frontend Web Development
21 of 63 cards from the CSS & Styling deck — real questions with worked answers.
In CSS, what does a selector's specificity measure, and how is it commonly represented?
Specificity is the weight a browser assigns to a selector to decide which rule wins when several target the same element. It is represented as a three-part value $(a, b, c)$: $a$ = number of ID selectors, $b$ = number of class/attribute/pseudo-class selectors, $c$ = number of type/element and pseudo-element selectors.
Rank these selector categories from highest to lowest specificity: element selectors, inline styles, ID selectors, class selectors.
Inline styles (highest) > ID selectors > class selectors (including attribute selectors and pseudo-classes) > element/type selectors (lowest). The universal selector $*$ adds no specificity.
What is the specificity of the selector `#nav .item a:hover` expressed as $(a,b,c)$?
$(1, 2, 1)$: one ID (`#nav`), two class/pseudo-class selectors (`.item` and `:hover`), and one type selector (`a`).
How does the `!important` flag interact with normal specificity in the cascade?
`!important` overrides normal declarations regardless of specificity. Among competing `!important` declarations, normal specificity and source order break the tie. It effectively creates a higher-priority layer above regular author declarations.
What are the two selectors that carry zero specificity, and why are they useful?
The universal selector `*` and the `:where()` pseudo-class both contribute zero specificity. They let you write low-priority defaults that are easy to override, unlike `:is()`, which takes the specificity of its most specific argument.
Define 'the cascade' in CSS and list its ordering criteria.
The cascade is the algorithm that resolves conflicting declarations for an element. It sorts by: (1) origin and importance (user agent, user, author; and whether `!important`), (2) specificity, then (3) source order — later rules win among equal specificity.
Which CSS properties are inherited by default, and which are not?
Text-related properties (e.g. `color`, `font-family`, `font-size`, `line-height`, `visibility`, `list-style`) inherit by default. Box/layout properties (e.g. `margin`, `padding`, `border`, `width`, `background`) do not inherit.
What do the CSS keywords `inherit`, `initial`, `unset`, and `revert` each do?
`inherit` takes the parent's computed value; `initial` sets the property's spec-defined default; `unset` acts as `inherit` for inherited properties and `initial` otherwise; `revert` rolls back to the value from the previous cascade origin (e.g. the user-agent stylesheet).
How does source order act as a tiebreaker in the cascade?
When two declarations have the same origin, importance, and specificity, the one that appears later in the source (or in a later-loaded stylesheet) wins.
List four common ways to specify a color in CSS and give an example of each.
Named keyword (`red`), hexadecimal (`#ff0000` or shorthand `#f00`), RGB/RGBA (`rgb(255 0 0 / 0.5)`), and HSL/HSLA (`hsl(0 100% 50%)`). Modern CSS also adds `hwb()`, `lab()`, `lch()`, and `oklch()`.
Distinguish absolute length units from relative length units in CSS, with examples.
Absolute units have fixed physical size regardless of context: `px`, `pt`, `cm`, `in`. Relative units scale to something else: `em` (relative to element's font size), `rem` (root font size), `%`, `vw`/`vh` (viewport), `ch`, `ex`.
What is the difference between the `em` and `rem` units?
`em` is relative to the font size of the current element (or the parent for `font-size` itself), so it compounds through nesting. `rem` is always relative to the root (`<html>`) font size, avoiding compounding.
If the root font size is $16\text{px}$ and an element is set to `font-size: 1.5rem`, what is its pixel size?
$1.5 \times 16\text{px} = 24\text{px}$.
What do the viewport units `vw`, `vh`, `vmin`, and `vmax` represent?
$1\text{vw} = 1\%$ of viewport width; $1\text{vh} = 1\%$ of viewport height; `vmin` = $1\%$ of the smaller viewport dimension; `vmax` = $1\%$ of the larger dimension.
What is the difference between a web-safe font and a web font (e.g. via `@font-face`)?
A web-safe font is pre-installed on most devices (e.g. Arial, Georgia), so no download is needed. A web font is downloaded from a server via `@font-face` or a service like Google Fonts, giving custom typography at the cost of extra network requests.
What does the `font-display` descriptor control, and what does `swap` do?
`font-display` controls how text renders while a web font loads. `swap` shows fallback text immediately (avoiding invisible text/FOIT) and swaps to the web font once loaded, at the cost of a possible flash of unstyled text (FOUT).
In the `font` shorthand, which sub-properties are mandatory?
`font-size` and `font-family` are mandatory (and must appear last, in that order). Optional leading values are `font-style`, `font-variant`, `font-weight`, and a `line-height` given as `font-size/line-height`.
What is the difference between `line-height` set as a unitless number versus a length like `px`?
A unitless `line-height` (e.g. `1.5`) is inherited as a factor, so children multiply it by their own font size. A length or percentage computes a fixed value on the parent that children inherit directly, which can break spacing at different font sizes.
In the `background` shorthand, what does the syntax `background: url(bg.png) no-repeat center / cover` mean?
It sets `background-image` to `bg.png`, `background-repeat` to `no-repeat`, `background-position` to `center`, and (after the slash) `background-size` to `cover`. The slash separates position from size.
What is the difference between `background-size: cover` and `background-size: contain`?
`cover` scales the image to completely fill the container (cropping overflow while preserving aspect ratio). `contain` scales it so the entire image is visible inside the container (possibly leaving empty space), also preserving aspect ratio.
In the `border` shorthand, what three values are set and in what conceptual order?
`border-width`, `border-style`, and `border-color` — e.g. `border: 2px solid #333`. The `border-style` is required for the border to appear; without it the border is not rendered.
Planning CSS & Styling for Frontend Web Development
CSS & Styling is about 18% of the Frontend Web Development syllabus by topic count — 26 of 142 topics, spread over 6 chapters. At roughly 45 minutes per topic plus 12 minutes per sub-topic, a first pass runs to about 20 hours.
The heaviest chapters are CSS Fundamentals (5 topics), Modern CSS Architecture (5 topics), The Box Model & Layout (4 topics) . Front-load those while your energy is high; the short chapters are better revision filler later.
Work top-down: read the chapter, then tick topics off individually rather than marking the whole chapter done. Sub-topics are where silent gaps hide.
CSS & Styling (Frontend Web Development) FAQ
What is in the Frontend Web Development CSS & Styling syllabus?
CSS & Styling is split into 6 chapters — CSS Fundamentals, The Box Model & Layout, Flexbox & Grid, Responsive Design, Transitions, Animations & Effects and Modern CSS Architecture, containing 26 topics and 0 sub-topics in total.
How is CSS & Styling structured in the Frontend Web Development syllabus?
6 chapters. CSS & Styling accounts for about 18% of the topics in the whole Frontend Web Development syllabus (26 of 142).
How long should I spend on CSS & Styling for Frontend Web Development?
Budget around 20 hours for a first pass through CSS & Styling — about 45 minutes per topic plus 12 minutes per sub-topic across its 26 topics. Add revision cycles on top.
Are there flashcards for Frontend Web Development CSS & Styling?
Yes — a 63-card CSS & Styling deck. Sample cards are printed on this page, and the full deck is free in the Examius app with spaced repetition scheduling.