๐ The Odin Project ยท subject
The Odin Project Intermediate & Advanced HTML and CSS Syllabus
The Intermediate & Advanced HTML and CSS syllabus for The Odin Project in full: 7 chapters and 37 topics, every one listed below, plus 50 Intermediate & Advanced HTML and CSS flashcards with answers.
Intermediate & Advanced HTML and CSS syllabus: all 7 chapters
Expand any chapter to see its topics and sub-topics.
-
Intermediate HTML Concepts
3 topics- Emmet
- SVG
- Tables
-
Intermediate CSS Concepts
9 topics- Default Styles
- CSS Units
- More Text Styles
- Advanced Selectors
- Positioning
- CSS Functions
- Custom Properties
- Browser Compatibility
- Frameworks and Preprocessors
-
Forms
3 topics- Form Basics
- Form Validation
- Project: Sign-up Form
-
Grid
6 topics- Introduction to Grid
- Creating a Grid
- Positioning Grid Elements
- Advanced Grid Properties
- Using Flexbox and Grid
- Project: Admin Dashboard
-
Animation
3 topics- Transforms
- Transitions
- Keyframes
-
Accessibility
8 topics- Introduction to Web Accessibility
- The Web Content Accessibility Guidelines (WCAG)
- Semantic HTML
- Accessible Colors
- Keyboard Navigation
- Meaningful Text
- WAI-ARIA
- Accessibility Auditing
-
Responsive Design
5 topics- Introduction to Responsive Design
- Natural Responsiveness
- Responsive Images
- Media Queries
- Project: Homepage
The Odin Project Intermediate & Advanced HTML and CSS flashcards โ 50 questions with answers
What is Emmet and why is it useful when writing HTML and CSS?
Emmet is a toolkit built into editors like VS Code that expands short, CSS-selector-like abbreviations into complete HTML or CSS. It dramatically speeds up writing markup, e.g. typing an abbreviation and pressing Tab generates full boilerplate or nested element structures.
In Emmet abbreviations, what do the operators `>`, `+`, `*`, and `^` mean, and what does `ul>li*3` expand to?
`>` creates a child, `+` creates a sibling, `*` multiplies an element, and `^` climbs up one level in the tree. `ul>li*3` expands to a `<ul>` containing three `<li>` elements.
What does SVG stand for, and how does an SVG image fundamentally differ from a raster image (JPG/PNG)?
SVG stands for Scalable Vector Graphics. It is an XML-based format that describes images with shapes, paths, and math rather than a grid of pixels, so SVGs scale to any size without losing quality and usually stay small in file size.
For which use cases are SVGs a good choice, and when are they a poor choice?
Good: icons, logos, simple illustrations, graphs/charts, and graphics that must scale, be animated, or be manipulated with CSS/JS. Poor: complex, photorealistic images โ storing that much detail as vector data makes the file enormous, so raster formats are better.
What are the two main ways to put an SVG on a web page, and what is the key trade-off between them?
Linked (via `<img src>` or a CSS `background-image`) versus inline (pasting the `<svg>` markup directly into the HTML). Inline SVG lets CSS and JavaScript access and style the SVG's internal elements, but it bloats the HTML and cannot be cached separately; linked SVG is cleaner and cacheable but its internals are not accessible.
What does the `viewBox` attribute of an `<svg>` element define?
It defines the SVG's internal coordinate system and aspect ratio using four values: min-x, min-y, width, and height. It maps the drawing's coordinates onto the rendered viewport, enabling scaling, panning, and zooming of the graphic.
Which four HTML elements form the basic structure of a table, and what does each represent?
`<table>` wraps the whole table, `<tr>` defines a table row, `<th>` defines a header cell (bold and centered by default, with semantic/accessibility meaning), and `<td>` defines a standard data cell.
What are `<thead>`, `<tbody>`, and `<tfoot>` used for, and what is the purpose of `<caption>`?
They group a table's header rows, main body rows, and footer/summary rows respectively, adding structure for styling and accessibility. `<caption>` provides a visible title/description of the table, which helps screen-reader users understand its purpose.
In HTML tables, what do the `colspan` and `rowspan` attributes do?
They make a single cell span multiple columns (`colspan`) or multiple rows (`rowspan`). For example `<td colspan="2">` makes the cell occupy the width of two columns.
What is the user-agent stylesheet, and why do links appear blue and `<h1>` text appears large even with no CSS written?
It is the browser's built-in default stylesheet applied to every page. Elements like headings, links, lists, and buttons get default margins, sizes, and colors from it, which is why unstyled HTML still has visible formatting โ and why defaults can differ slightly between browsers.
What is the difference between a CSS reset (e.g., Meyer reset) and Normalize.css?
A reset strips away virtually all browser default styles (margins, padding, list styles, etc.) so you start from a blank slate. Normalize.css instead keeps useful defaults but adjusts them so they render consistently across all browsers, and fixes common browser bugs.
In CSS, what is the difference between absolute and relative units? Give examples of each.
Absolute units are fixed and always the same size regardless of context โ e.g. `px`, `in`, `cm` (`px` is the only absolute unit commonly used on screens). Relative units are computed from something else โ e.g. `em` and `rem` (font-size based), `%` (parent based), and `vh`/`vw` (viewport based).
What is the difference between `em` and `rem`, and which does The Odin Project recommend for font sizes?
`1em` equals the font-size of the element itself (or of its parent when used on `font-size`), so values compound through nesting. `1rem` always equals the font-size of the root (`html`) element, so it is predictable. `rem` is recommended for font sizes because it respects the user's browser font-size setting without compounding.
What do the viewport units `vh`, `vw`, `vmin`, and `vmax` represent?
`1vh` is $\frac{1}{100}$ of the viewport height and `1vw` is $\frac{1}{100}$ of the viewport width. `1vmin` is $\frac{1}{100}$ of the smaller viewport dimension and `1vmax` is $\frac{1}{100}$ of the larger one. `height: 100vh` makes an element fill the full viewport height.
What does the CSS percentage unit (%) size an element relative to?
The corresponding dimension of its parent (containing block). For example, `width: 50%` makes the element half the width of its parent โ not half the screen โ so its size changes dynamically as the parent resizes.
What is the `@font-face` rule used for, and what are its two essential descriptors?
It lets you define and load a custom (self-hosted) font for use on your site. At minimum you provide `font-family` (the name you'll reference in your CSS) and `src` (the URL and format of the font file). Afterwards you use the declared name in `font-family` rules.
What is a font stack, and why should `font-family` always end with a generic family like `sans-serif`?
A font stack is a comma-separated list of fonts, e.g. `font-family: "Roboto", Helvetica, Arial, sans-serif;`. The browser uses the first font that is available; ending with a generic family (serif, sans-serif, monospace) guarantees a reasonable fallback if none of the named fonts load โ the basis of "web-safe" typography.
Which three CSS declarations are required together to truncate a single line of text with an ellipsis (โฆ)?
`overflow: hidden;` plus `white-space: nowrap;` plus `text-overflow: ellipsis;`. Without hiding overflow and preventing wrapping, `text-overflow: ellipsis` has no visible effect.
What is the difference between the descendant combinator (space) and the child combinator (`>`) in CSS selectors?
`A B` (descendant) selects every `B` nested anywhere inside `A`, at any depth. `A > B` (child) selects only `B` elements that are direct children of `A` โ one level down, nothing deeper.
What is the difference between the adjacent sibling combinator (`+`) and the general sibling combinator (`~`)?
`A + B` selects a `B` only when it immediately follows `A` as the very next sibling. `A ~ B` selects every `B` that follows `A` anywhere among its later siblings, not just the immediate next one.
Show the other 30 Intermediate & Advanced HTML and CSS flashcards
How do pseudo-classes differ from pseudo-elements in CSS, and how is each written?
Pseudo-classes (single colon, e.g. `:hover`, `:focus`, `:first-child`) select elements based on state or position in the tree. Pseudo-elements (double colon, e.g. `::before`, `::after`, `::first-letter`) target or create a specific part of an element that isn't a real DOM element, such as generated content.
What do CSS attribute selectors `[attr]`, `[attr="value"]`, `[attr^="val"]`, `[attr$="val"]`, and `[attr*="val"]` match?
`[attr]` โ elements that have the attribute at all; `[attr="value"]` โ exact value match; `^=` โ value begins with the string; `$=` โ value ends with the string; `*=` โ value contains the string anywhere. Example: `img[src$=".png"]` matches images whose src ends in .png.
What is the default value of the CSS `position` property, and what does it mean?
`position: static`. The element sits in the normal document flow, and the offset properties `top`, `right`, `bottom`, `left`, and `z-index` have no effect on it.
Compare `position: relative` and `position: absolute`.
Relative keeps the element in normal flow (its original space is preserved) and offsets it visually from where it would normally sit. Absolute removes the element from normal flow entirely and positions it relative to its nearest positioned ancestor (any ancestor whose position is not static), or the initial containing block if none exists.
How does `position: fixed` behave?
The element is removed from normal flow and positioned relative to the viewport using top/right/bottom/left, so it stays in the same place on screen while the page scrolls โ ideal for persistent navbars or floating buttons.
How does `position: sticky` behave, and how is it a hybrid of two other position values?
A sticky element behaves like `relative` (stays in normal flow) until the page scrolls past a specified threshold (e.g. `top: 0`), at which point it behaves like `fixed` and sticks in place โ but only within the bounds of its parent container. Useful for section headings that stay visible while their section scrolls.
What does the CSS `calc()` function do? Give an example.
It performs arithmetic ($+$, $-$, $\times$, $\div$) inside a CSS value and, crucially, can mix different units. Example: `height: calc(100vh - 60px)` fills the viewport minus a 60px header. Note the `+` and `-` operators must be surrounded by spaces.
What do the CSS `min()` and `max()` functions do?
Each takes a comma-separated list of values and uses one of them: `min()` applies the smallest computed value and `max()` applies the largest. Example: `width: min(150px, 100%)` gives 150px when space allows, but shrinks to 100% of the container when it is narrower โ a compact way to write responsive constraints.
What are the three arguments of the CSS `clamp()` function, and how does it resolve?
`clamp(minimum, ideal, maximum)`. The browser uses the ideal (often a fluid value like `2vw`) but never lets the result go below the minimum or above the maximum. Example: `font-size: clamp(1rem, 3vw, 2rem)` creates fluid type bounded between $1\,\text{rem}$ and $2\,\text{rem}$.
How do you declare a CSS custom property and how do you use it? What naming rule must the declaration follow?
Declare it inside a selector with a name starting with two dashes: `--main-color: navy;`. Use it anywhere with the `var()` function: `color: var(--main-color);`. Names are case-sensitive.
What is the purpose of the second argument in `var(--color-error, red)`?
It is a fallback value: if the custom property `--color-error` is not defined (or is invalid) for that element, the browser uses `red` instead. Fallbacks can even be nested with another `var()`.
Why are CSS custom properties commonly declared on the `:root` selector, and how does this enable theming?
`:root` matches the root `html` element with higher specificity, and custom properties inherit, so anything declared there is available to the entire document โ perfect for global design tokens. Themes (e.g. dark mode) work by redeclaring the same property names under a class or inside a `@media (prefers-color-scheme: dark)` block so all dependent styles update at once.
What is caniuse.com, and how is browser support information typically used before adopting a new CSS feature?
It is a reference site showing, per browser and version, whether an HTML/CSS/JS feature is supported (with global usage percentages). Developers check it before using a new feature; a feature is generally considered safe once all common, evergreen (auto-updating) browsers have released support โ brand-new features are risky because users on older versions won't get them.
Why does testing in Chrome or Firefox on iOS not prove cross-engine compatibility?
On iOS and iPadOS, Apple historically required every browser โ including Chrome and Firefox โ to run on WebKit, Safari's rendering engine. So all iOS browsers rendered like Safari, and a feature unsupported by WebKit was unavailable to iOS users regardless of which browser app they used; real-device or engine-accurate testing matters.
What is a CSS framework? Name two popular examples and describe how they differ in approach.
A framework is prewritten CSS (and sometimes JS) providing ready-made classes and components so you can build UIs quickly. Bootstrap is component-based (prebuilt buttons, navbars, grids), while Tailwind is utility-first (tiny single-purpose classes like `flex`, `pt-4` composed directly in markup).
What is a CSS preprocessor, and what features do tools like Sass add over plain CSS?
A preprocessor is a program that compiles an extended stylesheet language into ordinary CSS the browser can read. Sass/SCSS (also Less, Stylus) add features like variables, nesting, mixins, functions, loops, and file partials/imports, reducing repetition in large stylesheets.
What are the main disadvantages of relying on CSS frameworks, especially for learners?
Framework sites tend to look generic/similar; overriding built-in styles to customize designs can be difficult; you inherit the framework's bugs and bloat; and beginners who learn a framework before mastering CSS fundamentals struggle to debug or work outside it. Learn plain CSS first.
On an HTML `<form>` element, what do the `action` and `method` attributes specify, and when is GET vs POST used?
`action` is the URL the form data is sent to; `method` is the HTTP verb used. GET appends data to the URL as a query string and is used to retrieve data (e.g. searches); POST sends data in the request body and is used when submitting data that changes state or is sensitive (e.g. sign-ups, passwords).
Why must a form input have a `name` attribute, and what role does it play on submission?
The `name` acts as the variable/key for the input's value when the form is submitted โ data is sent as name=value pairs. Inputs without a `name` are simply ignored and their data never reaches the server.
How do you associate a `<label>` with a form input, and what two benefits does this provide?
Give the input an `id` and set the label's `for` attribute to the same value (or nest the input inside the label). Benefits: clicking the label focuses/activates the input, and screen readers announce the label when the input gains focus โ improving accessibility.
Compare radio buttons and checkboxes, and explain how radio buttons are grouped so only one can be selected.
Radio buttons (`type="radio"`) let the user pick exactly one option from a set; checkboxes (`type="checkbox"`) allow zero, one, or many selections. Radios become mutually exclusive by sharing the same `name` attribute value; `checked` preselects a default in either type.
What are the three values of a `<button>`'s `type` attribute, and why should you always set it explicitly inside a form?
`submit` (submits the enclosing form), `reset` (clears all form fields to defaults), and `button` (generic, no default behavior โ for JS). Inside a form, `type` defaults to `submit`, so an unlabeled button can accidentally submit the form; setting it explicitly avoids surprises.
Which built-in HTML validation attributes constrain (a) whether a field may be empty, (b) text length, and (c) numeric range?
(a) `required` โ the field must be filled before submission; (b) `minlength` and `maxlength` โ minimum/maximum number of characters; (c) `min` and `max` โ lowest/highest allowed values on number-type inputs. Violations block submission and show a browser error message.
What does the `pattern` attribute do on an input, and what should accompany it for usability?
It validates the input's value against a regular expression โ the whole value must match, e.g. `pattern="[0-9]{5}"` for a 5-digit zip code (works only on text-type inputs like text, tel, email, password). Pair it with a `title`/placeholder or visible hint so users know the expected format.
Which CSS pseudo-classes let you style form fields based on their validation state?
`:valid` and `:invalid` match inputs that currently pass or fail their constraints; `:required` and `:optional` match by the presence of the `required` attribute; also `:in-range`/`:out-of-range` for numeric bounds and `:placeholder-shown` for empty fields showing a placeholder.
Why is client-side (HTML/JS) form validation never sufficient on its own?
Because it runs in the user's browser, it can be bypassed entirely โ users can edit the HTML in DevTools, disable JS, or send requests directly to the server. Server-side validation must always duplicate the checks; client-side validation exists for fast feedback and UX, not security.
In a sign-up form like The Odin Project's project, why can't HTML validation attributes alone verify that "Password" and "Confirm Password" match, and what is the standard solution?
Built-in constraints (`required`, `pattern`, etc.) validate each field independently โ they cannot compare two fields. You need JavaScript: listen for input/submit, compare the two values, and use the Constraint Validation API (`setCustomValidity`) or custom error styling/messages to flag a mismatch before submission.
How does CSS Grid differ from Flexbox, and when is each the better choice?
Grid is two-dimensional โ it lays out rows and columns simultaneously โ while Flexbox is one-dimensional, controlling a single row or column at a time (with wrapping as a workaround). Use Grid for overall page layouts and anything needing row-and-column alignment; use Flexbox for distributing items along one axis. They also work well nested together.
How do you create a grid container, and which properties define its columns, rows, and spacing? What does the `fr` unit mean?
Set `display: grid` on a parent โ its direct children become grid items. `grid-template-columns` and `grid-template-rows` define track sizes (shorthand `grid-template: rows / columns`), often with `repeat()`, e.g. `repeat(3, 1fr)`. `gap` (or `row-gap`/`column-gap`) sets gutters. `1fr` is one fraction of the free space: with columns `2fr 1fr`, the first gets $\frac{2}{3}$ and the second $\frac{1}{3}$ of the available width.
In CSS Grid: (a) what is the difference between the explicit and implicit grid, and (b) how do grid line numbers relate to track count, and how are lines used to place an item?
(a) The explicit grid is what you define with `grid-template-columns/rows`; when extra items overflow it, the browser creates implicit tracks, sized by `grid-auto-rows`/`grid-auto-columns`. (b) A grid with $n$ tracks has $n+1$ numbered lines (also countable backwards from $-1$). Items are placed by line with `grid-column: start / end` and `grid-row: start / end` (or `grid-area: row-start / col-start / row-end / col-end`), and `span k` makes an item cover $k$ tracks, e.g. `grid-column: 1 / span 2`.
The Odin Project Intermediate & Advanced HTML and CSS FAQ
What is in the The Odin Project Intermediate & Advanced HTML and CSS syllabus?
The Odin Project Intermediate & Advanced HTML and CSS is split into 7 chapters: Intermediate HTML Concepts, Intermediate CSS Concepts, Forms, Grid, Animation, Accessibility and Responsive Design. Together they contain 37 topics.
How many chapters are in The Odin Project Intermediate & Advanced HTML and CSS?
7 chapters, containing 37 topics. The largest chapter is Intermediate CSS Concepts, with 9 topics.
Are there flashcards for The Odin Project Intermediate & Advanced HTML and CSS?
Yes โ a 50-card Intermediate & Advanced HTML and CSS deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.