DiscoveryVIP / HTML & CSS AcademyHelp

HTML and CSS glossary — 250 terms

HTML

A markup language that describes document meaning and structure.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

CSS

A style language that controls presentation through selectors, properties and the cascade.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Element

A document structure with a name, attributes and permitted content.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Tag

The source syntax marking an element’s start or end.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Attribute

A named value on an opening tag that supplies additional information.

Attributes add information to an opening tag, such as an identifier or language. Attribute values should be quoted consistently. id values identify a unique element and can be used by links and selectors. Comments explain intent to future authors but are not visible content. Nest children inside a permitted parent and close them in reverse order. The DOM tree is the final evidence of how the browser interpreted your nesting.

<!-- The introduction is a link target. -->
<section id="intro"><h1>Introduction</h1><p>Start with <em>one</em> change.</p></section>

Why it matters: The section has a stable link target and contains the heading and paragraph as children.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Document

A complete browser page with metadata and content.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

DOM

The tree of objects produced when a browser parses source.

Source code is the text you author, while the DOM is the tree the browser constructs from it. Browsers repair some invalid markup, so the resulting tree can differ from the typed source. Elements can contain text and permitted child elements. strong communicates importance and em communicates emphasis; choosing them solely for bold or italic appearance loses the meaning. Inspect the document tree after a change rather than assuming indentation defines nesting.

<p>Read <strong>important instructions</strong> before you <em>publish</em>.</p>

Why it matters: The important phrase is a child of the paragraph and has explicit importance semantics.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Parent

An element that directly contains another node.

Attributes add information to an opening tag, such as an identifier or language. Attribute values should be quoted consistently. id values identify a unique element and can be used by links and selectors. Comments explain intent to future authors but are not visible content. Nest children inside a permitted parent and close them in reverse order. The DOM tree is the final evidence of how the browser interpreted your nesting.

<!-- The introduction is a link target. -->
<section id="intro"><h1>Introduction</h1><p>Start with <em>one</em> change.</p></section>

Why it matters: The section has a stable link target and contains the heading and paragraph as children.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Child

A node directly contained by another node.

Source code is the text you author, while the DOM is the tree the browser constructs from it. Browsers repair some invalid markup, so the resulting tree can differ from the typed source. Elements can contain text and permitted child elements. strong communicates importance and em communicates emphasis; choosing them solely for bold or italic appearance loses the meaning. Inspect the document tree after a change rather than assuming indentation defines nesting.

<p>Read <strong>important instructions</strong> before you <em>publish</em>.</p>

Why it matters: The important phrase is a child of the paragraph and has explicit importance semantics.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Semantic HTML

Elements chosen for meaning rather than only default appearance.

Semantic elements describe purpose. main identifies the principal content; nav identifies navigation; article identifies a self-contained composition. A generic div remains appropriate when no more specific meaning applies. Do not select an element merely because its default display looks convenient. Review the landmark and heading outline together to understand the page.

<main><h1>Field Notes</h1><article><h2>Designing a small page</h2><p>Start with the content.</p></article></main>

Why it matters: A self-contained article is placed inside the principal content landmark.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Landmark

A page region that supports navigation by purpose.

Semantic elements describe purpose. main identifies the principal content; nav identifies navigation; article identifies a self-contained composition. A generic div remains appropriate when no more specific meaning applies. Do not select an element merely because its default display looks convenient. Review the landmark and heading outline together to understand the page.

<main><h1>Field Notes</h1><article><h2>Designing a small page</h2><p>Start with the content.</p></article></main>

Why it matters: A self-contained article is placed inside the principal content landmark.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Accessibility

Design that people with diverse abilities and technologies can use.

A complete HTML document includes a doctype, an html root with language, a head for metadata and a body for visible content. Developer tools expose the browser’s interpreted DOM and computed CSS, not just the original file. The academy inspector reports the actual sandbox DOM. Browser tools offer deeper debugging and accessibility inspection after export. A title belongs in head and appears in browser UI rather than as a visible body heading.

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Alex’s journal</title></head><body><h1>Learning journal</h1><p>Inspect this page.</p></body></html>

Why it matters: The root declares English so assistive technologies have a language cue; the document title identifies the tab.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Viewport

The CSS layout area available to a document.

A useful page title describes the specific page. The meta description summarizes its content but is not a guaranteed search-result snippet. The viewport meta element asks mobile browsers to use the device width in CSS pixels; it does not make a fixed-width layout responsive by itself. Keep metadata accurate instead of stuffing keywords. The academy’s exported document includes a complete shell, and authored full documents retain their own metadata.

<!doctype html><html lang="en"><head><title>Workshop registration — Field Notes</title><meta name="description" content="Register for a practical web design workshop."><meta name="viewport" content="width=device-width, initial-scale=1"></head><body><h1>Workshop registration</h1></body></html>

Why it matters: The page has a specific title and a concise description associated with the actual registration content.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Stylesheet

A collection of CSS rules attached to a document.

A stylesheet contains rules. A selector identifies elements, and declarations assign property/value pairs. CSS is interpreted independently of HTML structure, so a rule matching no elements has no visible effect. Start with one property and compare before combining many changes. The browser’s computed style reveals which value actually won, while the rule list shows candidate declarations.

<h1>A styled heading</h1><p>The content stays meaningful.</p>
h1 { color: #234f9b; }

Why it matters: Only the matched heading receives the blue text color; the paragraph keeps its inherited/default styling.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Selector

A pattern identifying elements to which a rule applies.

HTML supplies structure, CSS controls presentation and JavaScript can change behavior. They are separate layers: a heading remains a heading when its color changes. A CSS rule has a selector followed by a declaration block; color is a property and royalblue is its value. This example uses no JavaScript because styling alone needs none. The optional script editor is reserved for later interaction work. Predict which elements each selector matches before rendering.

<h1>Structure and style</h1>
<p>CSS changes presentation.</p>
h1 { color: royalblue; }
p { font-size: 18px; }

Why it matters: The paragraph becomes 18 CSS pixels while the heading receives its own color rule.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Declaration

A property/value pair inside a CSS block.

HTML supplies structure, CSS controls presentation and JavaScript can change behavior. They are separate layers: a heading remains a heading when its color changes. A CSS rule has a selector followed by a declaration block; color is a property and royalblue is its value. This example uses no JavaScript because styling alone needs none. The optional script editor is reserved for later interaction work. Predict which elements each selector matches before rendering.

<h1>Structure and style</h1>
<p>CSS changes presentation.</p>
h1 { color: royalblue; }
p { font-size: 18px; }

Why it matters: The paragraph becomes 18 CSS pixels while the heading receives its own color rule.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Property

A named CSS presentation feature such as padding.

HTML supplies structure, CSS controls presentation and JavaScript can change behavior. They are separate layers: a heading remains a heading when its color changes. A CSS rule has a selector followed by a declaration block; color is a property and royalblue is its value. This example uses no JavaScript because styling alone needs none. The optional script editor is reserved for later interaction work. Predict which elements each selector matches before rendering.

<h1>Structure and style</h1>
<p>CSS changes presentation.</p>
h1 { color: royalblue; }
p { font-size: 18px; }

Why it matters: The paragraph becomes 18 CSS pixels while the heading receives its own color rule.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Value

The specific setting assigned to a CSS property.

HTML supplies structure, CSS controls presentation and JavaScript can change behavior. They are separate layers: a heading remains a heading when its color changes. A CSS rule has a selector followed by a declaration block; color is a property and royalblue is its value. This example uses no JavaScript because styling alone needs none. The optional script editor is reserved for later interaction work. Predict which elements each selector matches before rendering.

<h1>Structure and style</h1>
<p>CSS changes presentation.</p>
h1 { color: royalblue; }
p { font-size: 18px; }

Why it matters: The paragraph becomes 18 CSS pixels while the heading receives its own color rule.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Cascade

The ordered process that selects applicable winning declarations.

An inline style is attached to one element, an internal style element contains rules in a document, and an external stylesheet is linked by a path. External files are easier to share across pages. The academy’s CSS editor represents styles.css and the export links it automatically for fragments. A full authored document can include its own style or project stylesheet links. Cascade order still matters when several sources apply.

<h1 style="text-decoration: underline;">Three places for CSS</h1><p class="note">The external stylesheet controls this paragraph.</p>
.note { font-weight: 700; }

Why it matters: The paragraph uses a reusable class rule, while the heading demonstrates a separate inline declaration.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Specificity

A lexicographic selector weight used after earlier cascade priorities tie.

A type selector matches element names, a class selector matches reusable class tokens, and an ID selector matches a unique identifier. Classes usually make reusable component styling easier than IDs. Specificity is only one stage in the cascade; importance, layers and origin can take precedence. Inspect actual matches before diagnosing a conflict.

<h1 id="page-title">Selector practice</h1><p class="highlight">A reusable highlight.</p><p>Unselected text.</p>
.highlight { background-color: #fff0b3; }

Why it matters: Only the paragraph with the matching class receives the background; the other paragraph remains unchanged.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Inheritance

The propagation of selected computed values from parent to child.

Some properties such as color inherit by default; many box-model properties do not. A declaration on the child can override an inherited value. inherit explicitly takes the parent’s computed value, while initial uses the property’s initial value rather than a user-agent styling convention. Inspect parent and child independently before blaming a selector that does not match.

<section class="parent"><p>Inherited text color</p><p class="own">An explicit child color</p></section>
.parent { color: #234f9b; } .own { color: #713b12; }

Why it matters: The child with its own declaration uses brown while the other paragraph inherits the parent’s blue.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Box model

The relationship of content, padding, border and margin.

The box model separates content from internal padding, border and external margin. A background extends through padding by default but margin stays outside it. With content-box sizing, a declared width excludes padding and border. The box-model inspector reports actual browser dimensions and computed edges; its diagram is a labeled educational view. Change one edge at a time and compare the outer width.

<div class="box">A box with content</div>
.box { width: 200px; padding: 20px; border: 2px solid #234f9b; margin: 16px; }

Why it matters: Twenty pixels of internal space separate content from its border; margin creates external separation.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Content box

The area containing the element’s actual content.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Padding

Internal space between content and border.

The box model separates content from internal padding, border and external margin. A background extends through padding by default but margin stays outside it. With content-box sizing, a declared width excludes padding and border. The box-model inspector reports actual browser dimensions and computed edges; its diagram is a labeled educational view. Change one edge at a time and compare the outer width.

<div class="box">A box with content</div>
.box { width: 200px; padding: 20px; border: 2px solid #234f9b; margin: 16px; }

Why it matters: Twenty pixels of internal space separate content from its border; margin creates external separation.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Margin

External separation outside the border; some block margins collapse.

The box model separates content from internal padding, border and external margin. A background extends through padding by default but margin stays outside it. With content-box sizing, a declared width excludes padding and border. The box-model inspector reports actual browser dimensions and computed edges; its diagram is a labeled educational view. Change one edge at a time and compare the outer width.

<div class="box">A box with content</div>
.box { width: 200px; padding: 20px; border: 2px solid #234f9b; margin: 16px; }

Why it matters: Twenty pixels of internal space separate content from its border; margin creates external separation.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Border

The edge between padding and external margin.

A caption names the table. scope clarifies whether a header applies to its row or column in simple tables. Complex multi-level tables may need explicit header associations and often benefit from redesign. Visual bold text alone does not make a data cell a header. Review relationships without relying on color or borders.

<table><caption>Available seats</caption><tr><th scope="col">Day</th><th scope="col">Seats</th></tr><tr><th scope="row">Monday</th><td>12</td></tr></table>
table { border-collapse: collapse; } th,td { padding:.6rem; border-bottom:1px solid #aaa; }

Why it matters: Monday is a row header and the table caption supplies context for the seat count.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Flexbox

A layout model primarily coordinating items along one axis.

A flex container lays out its direct children as flex items. flex-direction determines the main axis; the cross axis is perpendicular. justify-content works along the main axis and align-items along the cross axis, so their visual directions change when flex-direction changes. Flexbox is useful for distributing a one-dimensional group whose sizes may vary.

<div class="layout"><article>Discover</article><article>Experiment</article><article>Build</article></div>
.layout { display: flex; flex-direction: row; gap: 1rem; } article { padding: 1rem; background:#e8eef7; }

Why it matters: The articles become direct flex items in a row and participate in flex sizing.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Main axis

The axis established by flex-direction.

A flex container lays out its direct children as flex items. flex-direction determines the main axis; the cross axis is perpendicular. justify-content works along the main axis and align-items along the cross axis, so their visual directions change when flex-direction changes. Flexbox is useful for distributing a one-dimensional group whose sizes may vary.

<div class="layout"><article>Discover</article><article>Experiment</article><article>Build</article></div>
.layout { display: flex; flex-direction: row; gap: 1rem; } article { padding: 1rem; background:#e8eef7; }

Why it matters: The articles become direct flex items in a row and participate in flex sizing.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Cross axis

The axis perpendicular to a flex container’s main axis.

A flex container lays out its direct children as flex items. flex-direction determines the main axis; the cross axis is perpendicular. justify-content works along the main axis and align-items along the cross axis, so their visual directions change when flex-direction changes. Flexbox is useful for distributing a one-dimensional group whose sizes may vary.

<div class="layout"><article>Discover</article><article>Experiment</article><article>Build</article></div>
.layout { display: flex; flex-direction: row; gap: 1rem; } article { padding: 1rem; background:#e8eef7; }

Why it matters: The articles become direct flex items in a row and participate in flex sizing.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Grid

A layout model coordinating rows and columns of tracks.

Choose structures according to relationships. A description list pairs terms with definitions; a table relates two dimensions; a list groups peers. Using extra div elements for every pair makes those relationships harder to recover. Native elements usually need less custom accessibility work than invented roles. CSS can present a description list as a neat grid without changing its meaning.

<h1>Course facts</h1><dl><dt>Duration</dt><dd>Two afternoons</dd><dt>Prerequisite</dt><dd>A browser and curiosity</dd></dl>
dl { display: grid; grid-template-columns: 8rem 1fr; gap:.5rem; } dd { margin:0; }

Why it matters: Each term is paired with a description, while Grid handles the presentation.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Grid track

The space between two adjacent grid lines.

Grid tracks are the spaces between numbered lines. Columns and rows have independent definitions; gap separates tracks and is not an outer margin. Explicit track sizes can differ from the resulting used sizes when constraints or content intervene. Use the actual grid measurements and inspect long words rather than assuming a tidy short demo represents all inputs.

<div class="layout"><article>Discover</article><article>Experiment</article><article>Build</article></div>
.layout { display:grid; grid-template-columns: 2fr 1fr; grid-auto-rows:minmax(5rem, auto); gap:24px; } article { background:#e8eef7; padding:1rem; }

Why it matters: A 24px gap separates the tracks; the first column receives twice the flexible fraction of the second.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Grid area

A rectangular collection of grid cells.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Fractional unit

A share of remaining flexible grid space expressed with fr.

fr distributes remaining space among flexible tracks. repeat avoids duplicating track lists, and minmax sets a minimum and maximum for each track. minmax(0,1fr) can allow a track to shrink below its content’s automatic minimum when that matches the design. auto-fit collapses unused repeated tracks while auto-fill retains them. Compare at multiple widths rather than memorizing a magic string.

<div class="layout"><article>Discover</article><article>Experiment</article><article>Build</article></div>
.layout { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:1rem; } article { padding:1rem; background:#e8eef7; overflow-wrap:anywhere; }

Why it matters: The explicit grid uses three flexible tracks whose zero minimum avoids a common intrinsic-size overflow.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Media query

A conditional rule based on environmental features.

A media query conditionally applies rules according to the environment. Choose breakpoints where content needs them, not solely from device names. The browser evaluates width queries against the preview’s actual CSS viewport. The Responsive Lab reports active queries and measured overflow. Resize across both sides of the boundary and test the layout, not just the presence of a query.

<div class="layout"><article>Discover</article><article>Experiment</article><article>Build</article></div>
.layout { display:grid; grid-template-columns:1fr; gap:1rem; } @media (min-width: 700px) { .layout { grid-template-columns:1fr 1fr 1fr; } }

Why it matters: The single-column default gains three columns only when the width condition matches.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Breakpoint

A condition at which content needs a layout adaptation.

A media query conditionally applies rules according to the environment. Choose breakpoints where content needs them, not solely from device names. The browser evaluates width queries against the preview’s actual CSS viewport. The Responsive Lab reports active queries and measured overflow. Resize across both sides of the boundary and test the layout, not just the presence of a query.

<div class="layout"><article>Discover</article><article>Experiment</article><article>Build</article></div>
.layout { display:grid; grid-template-columns:1fr; gap:1rem; } @media (min-width: 700px) { .layout { grid-template-columns:1fr 1fr 1fr; } }

Why it matters: The single-column default gains three columns only when the width condition matches.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Container query

A conditional style based on an eligible ancestor container.

A size container query responds to an ancestor container’s dimensions rather than the viewport. Establish an eligible query container with container-type or container. A component can then adapt when placed in different page regions. Modern selectors such as :has express relationships but need target-browser checks. The lab uses CSS.supports and real match/computed information; it does not invent support for an unavailable feature.

<section class="container"><article class="card"><h1>Reusable report card</h1><p>Resize its container.</p></article></section>
.container { container-type:inline-size; max-width:40rem; } .card { padding:1rem; } @container (min-width: 400px) { .card { display:grid; grid-template-columns:1fr 1fr; } }

Why it matters: The ancestor becomes a size-query container so the component’s layout can depend on available inline size.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Responsive design

Layout and content that adapt to available conditions and user needs.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Typography

The coordinated presentation of text for meaning and readability.

A typography system coordinates a small set of sizes, weights and spacing values. Hierarchy should reflect content structure rather than arbitrary scale changes. A max-width in ch is an approximate reading measure, not an exact character count. Keep body text, headings and interactive controls consistent, and verify that longer titles wrap gracefully.

<article class="prose"><h1>A useful design system</h1><p class="lead">Start with clear content.</p><p>Use a readable measure and consistent vertical rhythm for longer explanations.</p></article>
.prose { max-width: 65ch; margin-inline: auto; padding: 1rem; font: 18px/1.6 system-ui; } .lead { font-size: 1.25em; }

Why it matters: The article has a controlled reading measure and a restrained lead-text size.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Contrast

A comparison of luminance under defined foreground/background assumptions.

Colors can be written as named values, hex, rgb or hsl, among other modern formats. Different notations may describe the same sRGB color. Alpha adds transparency, which changes the resulting contrast against the background. The contrast tool calculates opaque sRGB ratios and clearly states that scope. Do not infer accessibility from a color’s name or from its numerical lightness alone.

<p class="color-sample">A calm blue on white.</p>
.color-sample { color: rgb(35 79 155); background: white; }

Why it matters: The text color is specified directly while the white background makes the contrast context explicit.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Design token

A named reusable design decision such as a semantic color role.

A design token names a reusable design decision, such as surface, text or space. Semantic names survive theme changes better than names such as blue-button. Tokens should have a small intentional scale and be tested for contrast in each combination. Keep primitive values and semantic roles understandable; an enormous token file is not automatically a better design system.

<section class="token-card"><h1>Consistent decisions</h1><p>Tokens connect components.</p></section>
:root { --space:16px; --surface:#edf2fb; --text:#172f54; } .token-card { padding:var(--space); background:var(--surface); color:var(--text); }

Why it matters: The card reads its spacing and color roles from shared custom properties.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Custom property

A case-sensitive CSS variable participating in cascade and inheritance.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Pseudo-class

A selector for a state or structural relationship.

Specificity compares ID, class/attribute/pseudo-class, and type/pseudo-element contributions lexicographically after earlier cascade stages tie. It is not a decimal score. :where contributes zero; :is, :not and :has use the most specific argument. Inline styles and important declarations need additional cascade context. The calculator handles its documented selector grammar and flags unsupported nesting context rather than inventing a result.

<p id="notice" class="message">Specificity experiment</p>
.message { font-weight: 400; } #notice { font-weight: 700; }

Why it matters: The matching ID selector has greater specificity than the class selector in this otherwise tied example.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Pseudo-element

A selector addressing a special or generated part.

Specificity compares ID, class/attribute/pseudo-class, and type/pseudo-element contributions lexicographically after earlier cascade stages tie. It is not a decimal score. :where contributes zero; :is, :not and :has use the most specific argument. Inline styles and important declarations need additional cascade context. The calculator handles its documented selector grammar and flags unsupported nesting context rather than inventing a result.

<p id="notice" class="message">Specificity experiment</p>
.message { font-weight: 400; } #notice { font-weight: 700; }

Why it matters: The matching ID selector has greater specificity than the class selector in this otherwise tied example.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Transition

Interpolation when selected computed property values change.

A transition interpolates a property when its value changes. It needs a property with an animatable change and a nonzero duration. Use focus as well as hover when an effect communicates interaction. Avoid transition:all when only a few properties need motion, and respect reduced-motion preferences. The Animation Studio controls actual animations through browser APIs rather than drawing a pretend timeline.

<button class="motion">Hover or focus me</button>
.motion { background:#234f9b; color:white; transition: background-color 200ms ease; } .motion:hover,.motion:focus-visible { background:#713b12; } @media (prefers-reduced-motion:reduce) { .motion { transition:none; } }

Why it matters: A state change can animate the background color, while reduced-motion users receive an immediate change.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Transform

A visual coordinate transformation that differs from normal-flow layout.

z-index participates within stacking contexts rather than ranking every element globally. Positioning, transforms, opacity and other features can establish new contexts. A child with a very large z-index cannot simply escape its ancestor’s stacking context. Compare the ancestor chain, not just the numeric value. Keep overlays rare and test that they do not obscure focus or content.

<div class="stage"><div class="back">Background card</div><div class="front">Foreground note</div></div>
.stage { position: relative; min-height: 10rem; } .back,.front { position:absolute; padding:2rem; } .back { background:#dae5f6; z-index:1; } .front { background:#ffe4b5; left:3rem; top:2rem; z-index:2; }

Why it matters: The foreground note stacks above the other positioned sibling inside the same relevant context.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Keyframe

A named point in an animation’s property-value timeline.

Keyframes define values at points along an animation timeline. animation-name connects an element to a named keyframe rule. Duration, iteration and fill behavior determine what users see before and after active motion. Start with a subtle bounded effect and provide a reduced-motion alternative. A CSS keyframe definition alone does not animate anything until a matching animation is assigned.

<div class="pulse">Learning in motion</div>
@keyframes reveal { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } } .pulse { animation:reveal 600ms ease both; } @media (prefers-reduced-motion:reduce) { .pulse { animation:none; } }

Why it matters: The named keyframes and animation assignment agree, producing a short reveal rather than an undefined animation.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Easing

The mapping from elapsed time to interpolated progress.

Easing controls how interpolated progress changes over time; it does not change the duration by itself. Linear movement has constant progress, while ease curves accelerate and decelerate. Steps create discrete changes. A timeline scrubber changes currentTime on actual browser animations, so it is meaningful only after an animation exists. Test whether motion helps the task rather than merely showing that it can move.

<div class="timing">Compare easing in the Animation Studio.</div>
@keyframes travel { to { transform:translateX(100px); } } .timing { display:inline-block; animation:travel 2s ease-in-out 2 alternate; }

Why it matters: The easing curve controls progress within each two-second iteration; alternate reverses the return direction.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Developer tools

Browser facilities for inspecting DOM, styles, geometry, behavior and accessibility.

A complete HTML document includes a doctype, an html root with language, a head for metadata and a body for visible content. Developer tools expose the browser’s interpreted DOM and computed CSS, not just the original file. The academy inspector reports the actual sandbox DOM. Browser tools offer deeper debugging and accessibility inspection after export. A title belongs in head and appears in browser UI rather than as a visible body heading.

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Alex’s journal</title></head><body><h1>Learning journal</h1><p>Inspect this page.</p></body></html>

Why it matters: The root declares English so assistive technologies have a language cue; the document title identifies the tab.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Static hosting

Serving files without an application backend executing per request.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Deployment

Making a reviewed project available at its intended hosting destination.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Relative path

A resource address resolved from the current document location.

An absolute URL includes a scheme and host; a relative path is resolved from the current document’s directory. A leading slash starts at the site root, not the current folder. File names are often case-sensitive after upload. In the Build Studio, project page links resolve against the active virtual file. Exported folders preserve the same relationship. Review internal links after renaming a page.

<h1>Path examples</h1>
<a href="about.html">About this project</a>
<a href="https://developer.mozilla.org/">MDN documentation</a>

Why it matters: The first URL is a sibling file; the second is an absolute external destination.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Alternative text

A purpose-appropriate text equivalent for an image.

An img is a void element with no closing tag. src identifies the resource, while alt supplies a text alternative for its purpose. Decorative images generally use an empty alt rather than repeating irrelevant details. Width and height establish an aspect ratio and reduce layout shifts. The academy includes original local SVG illustrations; uploaded assets are restricted to supported raster image formats.

<h1>Coastal journal</h1>
<img src="assets/landscape.svg" width="640" height="400" alt="Layered blue hills beneath a pale morning sky">
img { max-width: 100%; height: auto; }

Why it matters: The illustration has a purpose-specific text alternative and scales within its available width.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Accessible name

The programmatically determined label for an element or control.

A useful form needs visible labels, clear instructions, error associations and a predictable submit path. Required state should be explained in words rather than indicated by color alone. Native validation can help, but server validation is still necessary for real data. Use aria-describedby to connect help text without replacing the control’s accessible name.

<form><label for="full-name">Full name (required)</label><input id="full-name" name="name" required aria-describedby="name-help"><p id="name-help">Enter the name for your certificate.</p><button>Preview certificate</button></form>
label,input { display:block; }

Why it matters: The visible label names the control and help text adds context without being the only name.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Focus indicator

A visible sign of the keyboard’s current interaction target.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Source order

The document sequence followed by reading and keyboard navigation in normal cases.

The cascade filters applicable declarations and orders them by origin and importance, layers, specificity, scoping proximity where relevant and source order. Specificity alone is not a universal winning score. This small example isolates same-origin, same-layer, equal-specificity source order so the later declaration wins. The rule inspector lists candidates and computed values; it does not pretend to reconstruct every browser cascade decision.

<p class="message">Which declaration wins?</p>
.message { color: red; }
.message { color: #234f9b; }

Why it matters: With equal cascade priority and specificity, the later blue declaration overrides the earlier red declaration.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Stacking context

A self-contained ordering context for layered content.

z-index participates within stacking contexts rather than ranking every element globally. Positioning, transforms, opacity and other features can establish new contexts. A child with a very large z-index cannot simply escape its ancestor’s stacking context. Compare the ancestor chain, not just the numeric value. Keep overlays rare and test that they do not obscure focus or content.

<div class="stage"><div class="back">Background card</div><div class="front">Foreground note</div></div>
.stage { position: relative; min-height: 10rem; } .back,.front { position:absolute; padding:2rem; } .back { background:#dae5f6; z-index:1; } .front { background:#ffe4b5; left:3rem; top:2rem; z-index:2; }

Why it matters: The foreground note stacks above the other positioned sibling inside the same relevant context.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Overflow

Content extending beyond a box’s available area.

A figure groups self-contained content with an optional figcaption. The caption adds context; alt still describes an image’s relevant information. max-width prevents overflow while height:auto preserves the intrinsic ratio. Responsive source selection with picture or srcset changes the resource chosen by the browser, whereas CSS changes display size. Test both rather than assuming one solves the other.

<figure><img src="assets/landscape.svg" width="640" height="400" alt="Blue hill shapes"><figcaption>Original study illustration: layered landscape.</figcaption></figure>
figure { margin: 0; } img { max-width: 100%; height: auto; }

Why it matters: The caption belongs to the figure and the image keeps its aspect ratio as the viewport narrows.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Intrinsic size

A size derived from content or a replaced resource rather than only a specified length.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

CSS pixel

A reference unit used in CSS layout, distinct from physical device pixels.

A useful page title describes the specific page. The meta description summarizes its content but is not a guaranteed search-result snippet. The viewport meta element asks mobile browsers to use the device width in CSS pixels; it does not make a fixed-width layout responsive by itself. Keep metadata accurate instead of stuffing keywords. The academy’s exported document includes a complete shell, and authored full documents retain their own metadata.

<!doctype html><html lang="en"><head><title>Workshop registration — Field Notes</title><meta name="description" content="Register for a practical web design workshop."><meta name="viewport" content="width=device-width, initial-scale=1"></head><body><h1>Workshop registration</h1></body></html>

Why it matters: The page has a specific title and a concise description associated with the actual registration content.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Progressive enhancement

Providing usable content first and adding supported capabilities.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Reduced motion

A user preference for limiting nonessential animated movement.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Validation

Checking data or structure against an explicit contract.

A form groups controls whose named values can be submitted. HTML alone does not deliver email or store a registration. A real destination requires a server or configured service, plus validation and privacy decisions. In the academy, submissions are intercepted locally and reported as sample data. Use a submit button so keyboard and pointer users share the same form pathway.

<form><label>Name <input name="name" autocomplete="name" required></label><button type="submit">Preview registration</button></form><p>No real data is sent in this example.</p>
label { display:block; margin-bottom:1rem; }

Why it matters: The button participates in native form submission, which the sandbox reports locally without sending data.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Computed style

A browser-resolved presentation value for a particular element.

A stylesheet contains rules. A selector identifies elements, and declarations assign property/value pairs. CSS is interpreted independently of HTML structure, so a rule matching no elements has no visible effect. Start with one property and compare before combining many changes. The browser’s computed style reveals which value actually won, while the rule list shows candidate declarations.

<h1>A styled heading</h1><p>The content stays meaningful.</p>
h1 { color: #234f9b; }

Why it matters: Only the matched heading receives the blue text color; the paragraph keeps its inherited/default styling.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Iframe sandbox

An isolated embedded document with restricted capabilities.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

IndexedDB

Browser-local structured storage that can be cleared by the user or browser.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Vibe Learning

Discover, predict, understand, experiment, build, test, explain, reflect and extend.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Vibe Teaching

Teaching through observable problems, guided experiments and evidence-based explanation.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

Disciplined Vibe Coding

Using AI proposals while independently checking source, behavior and publication assumptions.

A website is a collection of resources that a browser retrieves and interprets. HTML describes content and meaning; the browser builds a document tree and applies default presentation even without CSS. An element consists of an opening tag, content and usually a closing tag. h1 identifies the page’s principal heading, while p marks a paragraph. The preview is a real browser document inside an isolated frame. Changing source does not affect the page until it is rendered again, unless automatic preview is enabled. Start by editing words rather than adding layout rules.

<h1>My First Website</h1>
<p>I am learning HTML and CSS.</p>

Why it matters: One main heading appears above a paragraph. The heading is semantic content, not merely a large font.

Common misunderstanding: An attractive preview does not by itself prove the intended semantics, behavior or accessibility.

Related lesson

color

Sets the foreground text color; contrast depends on the actual background.

Grammar: <color>. Inherited: True. Layout context: block.

.sample { color: #17324d; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-color

Paints the background color behind content and padding.

Grammar: <color>. Inherited: False. Layout context: block.

.sample { background-color: #e3edf8; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-image

Adds a decorative background layer without replacing semantic content.

Grammar: <bg-image>#. Inherited: False. Layout context: block.

.sample { background-image: linear-gradient(120deg,#dce9fa,#f7dfc1); }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-size

Sizes each background image layer rather than the element itself.

Grammar: <bg-size>#. Inherited: False. Layout context: block.

.sample { background-size: 40px 40px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-position

Positions a background image inside its positioning area.

Grammar: <bg-position>#. Inherited: False. Layout context: block.

.sample { background-position: center; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-repeat

Controls whether a background image tiles.

Grammar: <repeat-style>#. Inherited: False. Layout context: block.

.sample { background-repeat: no-repeat; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-origin

Chooses the box used to position background images.

Grammar: <visual-box>#. Inherited: False. Layout context: block.

.sample { background-origin: content-box; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-clip

Limits the background painting area.

Grammar: <bg-clip>#. Inherited: False. Layout context: block.

.sample { background-clip: padding-box; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-attachment

Controls background scrolling behavior; test fixed backgrounds on target devices.

Grammar: <attachment>#. Inherited: False. Layout context: block.

.sample { background-attachment: scroll; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

background-blend-mode

Combines overlapping background layers through a blending operation.

Grammar: <blend-mode>#. Inherited: False. Layout context: block.

.sample { background-blend-mode: multiply; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

opacity

Makes the entire composited element translucent, including its content.

Grammar: <opacity-value>. Inherited: False. Layout context: block.

.sample { opacity: 0.7; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-family

Chooses a font stack with a generic fallback.

Grammar: [ <family-name> | <generic-family> ]#. Inherited: True. Layout context: block.

.sample { font-family: Georgia, serif; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-size

Sets the text size, subject to zoom and inherited context.

Grammar: <absolute-size> | <relative-size> | <length-percentage [0,∞]> | math. Inherited: True. Layout context: block.

.sample { font-size: 24px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-weight

Selects a supported weight; available faces affect the result.

Grammar: <font-weight-absolute> | bolder | lighter. Inherited: True. Layout context: block.

.sample { font-weight: 700; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-style

Selects an italic or oblique face/style where available.

Grammar: normal | italic | oblique <angle>?. Inherited: True. Layout context: block.

.sample { font-style: italic; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-variant

Requests typographic variants rather than changing the underlying text.

Grammar: normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ]. Inherited: True. Layout context: block.

.sample { font-variant: small-caps; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-stretch

Requests a condensed font width when the chosen font supports it.

Grammar: <font-stretch-absolute>. Inherited: True. Layout context: block.

.sample { font-stretch: condensed; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-kerning

Controls adjustment of space between particular glyph pairs.

Grammar: auto | normal | none. Inherited: True. Layout context: block.

.sample { font-kerning: normal; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-feature-settings

Sets low-level font features supported by the selected font.

Grammar: normal | <feature-tag-value>#. Inherited: True. Layout context: block.

.sample { font-feature-settings: "liga" 1; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-variation-settings

Adjusts axes of a variable font when that font supplies them.

Grammar: normal | [ <string> <number> ]#. Inherited: True. Layout context: block.

.sample { font-variation-settings: "wght" 650; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-optical-sizing

Allows a font’s optical-size axis to adapt where supported.

Grammar: auto | none. Inherited: True. Layout context: block.

.sample { font-optical-sizing: auto; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

font-size-adjust

Adjusts apparent lowercase size across font fallbacks.

Grammar: none | [ ex-height | cap-height | ch-width | ic-width | ic-height ]? [ from-font | <number> ]. Inherited: True. Layout context: block.

.sample { font-size-adjust: 0.5; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

line-height

Controls baseline spacing; a unitless factor inherits usefully.

Grammar: normal | <number> | <length> | <percentage>. Inherited: True. Layout context: block.

.sample { line-height: 1.7; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

letter-spacing

Changes tracking between characters without inserting actual spaces.

Grammar: normal | <length>. Inherited: True. Layout context: block.

.sample { letter-spacing: 0.08em; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

word-spacing

Adjusts spacing between words.

Grammar: normal | <length>. Inherited: True. Layout context: block.

.sample { word-spacing: 0.3em; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-align

Aligns inline content within a line box.

Grammar: start | end | left | right | center | justify | match-parent. Inherited: True. Layout context: block.

.sample { text-align: center; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-align-last

Controls alignment of the final line of a text block.

Grammar: auto | start | end | left | right | center | justify. Inherited: True. Layout context: block.

.sample { text-align-last: start; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-indent

Indents the first formatted line.

Grammar: <length-percentage> && hanging? && each-line?. Inherited: True. Layout context: block.

.sample { text-indent: 2em; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-transform

Transforms presentation without rewriting source text.

Grammar: none | [ capitalize | uppercase | lowercase ] || full-width || full-size-kana | math-auto. Inherited: True. Layout context: block.

.sample { text-transform: uppercase; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-decoration

Adds a text decoration; avoid confusing non-links with links.

Grammar: <'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> || <'text-decoration-thickness'>. Inherited: False. Layout context: block.

.sample { text-decoration: underline; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-decoration-color

Colors the decoration separately from glyphs.

Grammar: <color>. Inherited: False. Layout context: block.

.sample { text-decoration-color: #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-decoration-line

Chooses the decoration lines.

Grammar: none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error. Inherited: False. Layout context: block.

.sample { text-decoration-line: underline overline; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-decoration-style

Chooses the decoration stroke pattern.

Grammar: solid | double | dotted | dashed | wavy. Inherited: False. Layout context: block.

.sample { text-decoration-style: wavy; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-decoration-thickness

Sets decoration thickness.

Grammar: auto | from-font | <length> | <percentage>. Inherited: False. Layout context: block.

.sample { text-decoration-thickness: 3px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-underline-offset

Moves an underline away from its default position.

Grammar: auto | <length> | <percentage>. Inherited: True. Layout context: block.

.sample { text-underline-offset: 0.2em; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-shadow

Adds a visual text shadow; preserve readability.

Grammar: none | <shadow-t>#. Inherited: True. Layout context: block.

.sample { text-shadow: 2px 2px 3px #a8b8c8; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-overflow

Signals clipped inline overflow when other necessary constraints exist.

Grammar: [ clip | ellipsis | <string> ]{1,2}. Inherited: False. Layout context: constrained scrolling box.

.sample { text-overflow: ellipsis; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

white-space

Preserves whitespace while allowing wrapping.

Grammar: normal | pre | pre-wrap | pre-line | <'white-space-collapse'> || <'text-wrap-mode'>. Inherited: True. Layout context: block.

.sample { white-space: pre-wrap; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

overflow-wrap

Permits long unbroken text to wrap to avoid overflow.

Grammar: normal | break-word | anywhere. Inherited: True. Layout context: constrained scrolling box.

.sample { overflow-wrap: anywhere; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

word-break

Controls word-breaking rules; language affects behavior.

Grammar: normal | break-all | keep-all | break-word | auto-phrase. Inherited: True. Layout context: block.

.sample { word-break: normal; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

hyphens

Permits automatic hyphenation when language and dictionaries support it.

Grammar: none | manual | auto. Inherited: True. Layout context: block.

.sample { hyphens: auto; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-wrap

Requests balanced wrapping where supported; check actual browser behavior.

Grammar: <'text-wrap-mode'> || <'text-wrap-style'>. Inherited: True. Layout context: block.

.sample { text-wrap: balance; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

vertical-align

Aligns inline-level or table-cell content, not arbitrary block boxes.

Grammar: baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>. Inherited: False. Layout context: block.

.sample { vertical-align: middle; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

direction

Sets base inline direction; use HTML dir for content direction where appropriate.

Grammar: ltr | rtl. Inherited: True. Layout context: block.

.sample { direction: rtl; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

unicode-bidi

Isolates bidirectional text interactions.

Grammar: normal | embed | isolate | bidi-override | isolate-override | plaintext. Inherited: False. Layout context: block.

.sample { unicode-bidi: isolate; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

writing-mode

Changes the direction of text flow and logical axes.

Grammar: horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr. Inherited: True. Layout context: block.

.sample { writing-mode: vertical-rl; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

text-orientation

Controls glyph orientation in vertical writing modes.

Grammar: mixed | upright | sideways. Inherited: True. Layout context: block.

.sample { text-orientation: mixed; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

width

Sets preferred box width, interpreted by box-sizing.

Grammar: auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>. Inherited: False. Layout context: block.

.sample { width: 240px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

height

Sets preferred box height; fixed heights can clip growing content.

Grammar: auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>. Inherited: False. Layout context: block.

.sample { height: 140px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

min-width

Constrains the minimum width.

Grammar: auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>. Inherited: False. Layout context: block.

.sample { min-width: 160px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

max-width

Constrains the maximum width without requiring a fixed width.

Grammar: none | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>. Inherited: False. Layout context: block.

.sample { max-width: 28rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

min-height

Provides a minimum height while allowing growth.

Grammar: auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>. Inherited: False. Layout context: block.

.sample { min-height: 8rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

max-height

Constrains height; pair with deliberate overflow behavior.

Grammar: none | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>. Inherited: False. Layout context: block.

.sample { max-height: 12rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

inline-size

Sets preferred size along the logical inline axis.

Grammar: <'width'>. Inherited: False. Layout context: block.

.sample { inline-size: 260px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

block-size

Sets preferred size along the logical block axis.

Grammar: <'width'>. Inherited: False. Layout context: block.

.sample { block-size: 140px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

min-inline-size

Constrains minimum logical inline size.

Grammar: <'min-width'>. Inherited: False. Layout context: block.

.sample { min-inline-size: 160px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

max-inline-size

Constrains maximum logical inline size.

Grammar: <'max-width'>. Inherited: False. Layout context: block.

.sample { max-inline-size: 30rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

min-block-size

Constrains minimum logical block size.

Grammar: <'min-width'>. Inherited: False. Layout context: block.

.sample { min-block-size: 8rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

max-block-size

Constrains maximum logical block size.

Grammar: <'max-width'>. Inherited: False. Layout context: block.

.sample { max-block-size: 15rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

aspect-ratio

Provides a preferred width-to-height ratio when sizing allows.

Grammar: auto || <ratio>. Inherited: False. Layout context: replaced image.

.sample { aspect-ratio: 16 / 9; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

box-sizing

Includes padding and border in specified dimensions; margin remains outside.

Grammar: content-box | border-box. Inherited: False. Layout context: block.

.sample { box-sizing: border-box; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-top

Sets top internal spacing.

Grammar: <length-percentage [0,∞]>. Inherited: False. Layout context: block.

.sample { padding-top: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-right

Sets right internal spacing in physical coordinates.

Grammar: <length-percentage [0,∞]>. Inherited: False. Layout context: block.

.sample { padding-right: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-bottom

Sets bottom internal spacing.

Grammar: <length-percentage [0,∞]>. Inherited: False. Layout context: block.

.sample { padding-bottom: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-left

Sets left internal spacing in physical coordinates.

Grammar: <length-percentage [0,∞]>. Inherited: False. Layout context: block.

.sample { padding-left: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-inline

Sets internal spacing on logical inline edges.

Grammar: <'padding-top'>{1,2}. Inherited: False. Layout context: block.

.sample { padding-inline: 24px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-block

Sets internal spacing on logical block edges.

Grammar: <'padding-top'>{1,2}. Inherited: False. Layout context: block.

.sample { padding-block: 16px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-inline-start

Sets internal spacing at the logical inline start.

Grammar: <'padding-top'>. Inherited: False. Layout context: block.

.sample { padding-inline-start: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-inline-end

Sets internal spacing at the logical inline end.

Grammar: <'padding-top'>. Inherited: False. Layout context: block.

.sample { padding-inline-end: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-block-start

Sets internal spacing at the logical block start.

Grammar: <'padding-top'>. Inherited: False. Layout context: block.

.sample { padding-block-start: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

padding-block-end

Sets internal spacing at the logical block end.

Grammar: <'padding-top'>. Inherited: False. Layout context: block.

.sample { padding-block-end: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-top

Sets the top external margin.

Grammar: <length-percentage> | auto | <anchor-size()>. Inherited: False. Layout context: block.

.sample { margin-top: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-right

Sets the right external margin.

Grammar: <length-percentage> | auto | <anchor-size()>. Inherited: False. Layout context: block.

.sample { margin-right: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-bottom

Sets the bottom external margin.

Grammar: <length-percentage> | auto | <anchor-size()>. Inherited: False. Layout context: block.

.sample { margin-bottom: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-left

Sets the left external margin.

Grammar: <length-percentage> | auto | <anchor-size()>. Inherited: False. Layout context: block.

.sample { margin-left: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-inline

Can center an appropriately sized block along the inline axis.

Grammar: <'margin-top'>{1,2}. Inherited: False. Layout context: block.

.sample { margin-inline: auto; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-block

Sets logical block-axis separation.

Grammar: <'margin-top'>{1,2}. Inherited: False. Layout context: block.

.sample { margin-block: 24px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-inline-start

Sets external spacing at the logical inline start.

Grammar: <'margin-top'>. Inherited: False. Layout context: block.

.sample { margin-inline-start: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-inline-end

Sets external spacing at the logical inline end.

Grammar: <'margin-top'>. Inherited: False. Layout context: block.

.sample { margin-inline-end: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-block-start

Sets external spacing at the logical block start.

Grammar: <'margin-top'>. Inherited: False. Layout context: block.

.sample { margin-block-start: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

margin-block-end

Sets external spacing at the logical block end.

Grammar: <'margin-top'>. Inherited: False. Layout context: block.

.sample { margin-block-end: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-width

Sets border thickness, visible when a non-none border style applies.

Grammar: <line-width>{1,4}. Inherited: False. Layout context: block.

.sample { border-width: 4px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-style

Sets the border stroke pattern.

Grammar: <line-style>{1,4}. Inherited: False. Layout context: block.

.sample { border-style: dashed; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-color

Sets border color independently of width and style.

Grammar: <color>{1,4}. Inherited: False. Layout context: block.

.sample { border-color: #234f9b; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-top

Styles the top border.

Grammar: <line-width> || <line-style> || <color>. Inherited: False. Layout context: block.

.sample { border-top: 4px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-right

Styles the right border.

Grammar: <line-width> || <line-style> || <color>. Inherited: False. Layout context: block.

.sample { border-right: 4px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-bottom

Styles the bottom border.

Grammar: <line-width> || <line-style> || <color>. Inherited: False. Layout context: block.

.sample { border-bottom: 4px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-left

Styles the left border.

Grammar: <line-width> || <line-style> || <color>. Inherited: False. Layout context: block.

.sample { border-left: 4px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-inline

Styles the borders at logical inline edges.

Grammar: <'border-top'>. Inherited: False. Layout context: block.

.sample { border-inline: 4px solid #234f9b; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-block

Styles the borders at logical block edges.

Grammar: <'border-top'>. Inherited: False. Layout context: block.

.sample { border-block: 4px solid #234f9b; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-inline-start

Styles the logical inline-start border.

Grammar: <'border-top'>. Inherited: False. Layout context: block.

.sample { border-inline-start: 4px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-inline-end

Styles the logical inline-end border.

Grammar: <'border-top'>. Inherited: False. Layout context: block.

.sample { border-inline-end: 4px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-block-start

Styles the logical block-start border.

Grammar: <'border-top'>. Inherited: False. Layout context: block.

.sample { border-block-start: 4px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-block-end

Styles the logical block-end border.

Grammar: <'border-top'>. Inherited: False. Layout context: block.

.sample { border-block-end: 4px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-radius

Rounds border corners without changing the box’s dimensions.

Grammar: <length-percentage [0,∞]>{1,4} [ / <length-percentage [0,∞]>{1,4} ]?. Inherited: False. Layout context: block.

.sample { border-radius: 24px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-top-left-radius

Rounds the top-left corner.

Grammar: <length-percentage [0,∞]>{1,2}. Inherited: False. Layout context: block.

.sample { border-top-left-radius: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-top-right-radius

Rounds the top-right corner.

Grammar: <length-percentage [0,∞]>{1,2}. Inherited: False. Layout context: block.

.sample { border-top-right-radius: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-bottom-left-radius

Rounds the bottom-left corner.

Grammar: <length-percentage [0,∞]>{1,2}. Inherited: False. Layout context: block.

.sample { border-bottom-left-radius: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-bottom-right-radius

Rounds the bottom-right corner.

Grammar: <length-percentage [0,∞]>{1,2}. Inherited: False. Layout context: block.

.sample { border-bottom-right-radius: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-start-start-radius

Rounds a corner relative to writing mode and direction.

Grammar: <'border-top-left-radius'>. Inherited: False. Layout context: block.

.sample { border-start-start-radius: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-start-end-radius

Rounds the logical start/end corner.

Grammar: <'border-top-left-radius'>. Inherited: False. Layout context: block.

.sample { border-start-end-radius: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-end-start-radius

Rounds the logical end/start corner.

Grammar: <'border-top-left-radius'>. Inherited: False. Layout context: block.

.sample { border-end-start-radius: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-end-end-radius

Rounds the logical end/end corner.

Grammar: <'border-top-left-radius'>. Inherited: False. Layout context: block.

.sample { border-end-end-radius: 32px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

outline

Draws an outline without consuming normal box-model space.

Grammar: <'outline-width'> || <'outline-style'> || <'outline-color'>. Inherited: False. Layout context: block.

.sample { outline: 3px solid #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

outline-width

Sets outline thickness when an outline style is present.

Grammar: <line-width>. Inherited: False. Layout context: block.

.sample { outline-width: 4px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

outline-style

Sets the outline pattern; do not remove focus indicators without replacement.

Grammar: auto | <outline-line-style>. Inherited: False. Layout context: block.

.sample { outline-style: dashed; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

outline-color

Sets outline color.

Grammar: auto | <color>. Inherited: False. Layout context: block.

.sample { outline-color: #a44322; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

outline-offset

Separates an outline from the element’s edge.

Grammar: <length>. Inherited: False. Layout context: block.

.sample { outline-offset: 5px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

box-shadow

Adds a shadow without participating in normal-flow sizing.

Grammar: none | <shadow>#. Inherited: False. Layout context: block.

.sample { box-shadow: 0 12px 28px #17324d33; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

display

Selects outer/inner display behavior; Grid establishes a layout context.

Grammar: [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>. Inherited: False. Layout context: block.

.sample { display: grid; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

visibility

Hides the box visually while commonly retaining its layout space.

Grammar: visible | hidden | collapse. Inherited: True. Layout context: block.

.sample { visibility: hidden; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

position

Establishes positioned behavior while retaining normal-flow space.

Grammar: static | relative | absolute | sticky | fixed. Inherited: False. Layout context: positioned box.

.sample { position: relative; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

top

Offsets a positioned element along the top axis.

Grammar: auto | <length-percentage> | <anchor()> | <anchor-size()>. Inherited: False. Layout context: positioned box.

.sample { top: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

right

Sets the right inset for positioned layout.

Grammar: auto | <length-percentage> | <anchor()> | <anchor-size()>. Inherited: False. Layout context: positioned box.

.sample { right: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

bottom

Sets the bottom inset for positioned layout.

Grammar: auto | <length-percentage> | <anchor()> | <anchor-size()>. Inherited: False. Layout context: positioned box.

.sample { bottom: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

left

Offsets a positioned element along the left axis.

Grammar: auto | <length-percentage> | <anchor()> | <anchor-size()>. Inherited: False. Layout context: positioned box.

.sample { left: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

inset

Sets the four physical insets together.

Grammar: <'top'>{1,4}. Inherited: False. Layout context: positioned box.

.sample { inset: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

inset-inline

Sets logical inline insets for a positioned element.

Grammar: <'top'>{1,2}. Inherited: False. Layout context: block.

.sample { inset-inline: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

inset-block

Sets logical block insets for a positioned element.

Grammar: <'top'>{1,2}. Inherited: False. Layout context: block.

.sample { inset-block: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

inset-inline-start

Sets the logical inline-start inset.

Grammar: <'top'>. Inherited: False. Layout context: block.

.sample { inset-inline-start: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

inset-inline-end

Sets the logical inline-end inset.

Grammar: <'top'>. Inherited: False. Layout context: block.

.sample { inset-inline-end: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

inset-block-start

Sets the logical block-start inset.

Grammar: <'top'>. Inherited: False. Layout context: block.

.sample { inset-block-start: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

inset-block-end

Sets the logical block-end inset.

Grammar: <'top'>. Inherited: False. Layout context: block.

.sample { inset-block-end: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

z-index

Sets stack level in the relevant stacking context, not globally.

Grammar: auto | <integer>. Inherited: False. Layout context: positioned box.

.sample { z-index: 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

float

Floats a box toward a logical inline edge where supported.

Grammar: left | right | none | inline-start | inline-end. Inherited: False. Layout context: block.

.sample { float: inline-start; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

clear

Prevents a block from sitting alongside earlier relevant floats.

Grammar: none | left | right | both | inline-start | inline-end. Inherited: False. Layout context: block.

.sample { clear: both; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

overflow-x

Controls horizontal overflow independently.

Grammar: visible | hidden | clip | scroll | auto. Inherited: False. Layout context: constrained scrolling box.

.sample { overflow-x: auto; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

overflow-y

Controls vertical overflow and can reserve a scrollbar.

Grammar: visible | hidden | clip | scroll | auto. Inherited: False. Layout context: constrained scrolling box.

.sample { overflow-y: scroll; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

overflow-inline

Controls overflow along the logical inline axis where supported.

Grammar: visible | hidden | clip | scroll | auto. Inherited: False. Layout context: constrained scrolling box.

.sample { overflow-inline: auto; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

overflow-block

Controls overflow along the logical block axis where supported.

Grammar: visible | hidden | clip | scroll | auto. Inherited: False. Layout context: constrained scrolling box.

.sample { overflow-block: auto; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

scroll-behavior

Requests smooth programmatic/anchor scrolling; respect motion preferences.

Grammar: auto | smooth. Inherited: False. Layout context: constrained scrolling box.

.sample { scroll-behavior: smooth; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

scroll-margin-top

Adds a scroll alignment margin, useful below sticky headers.

Grammar: <length>. Inherited: False. Layout context: constrained scrolling box.

.sample { scroll-margin-top: 64px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

scroll-padding-top

Offsets the optimal viewing region of a scroll container.

Grammar: auto | <length-percentage>. Inherited: False. Layout context: constrained scrolling box.

.sample { scroll-padding-top: 64px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

scroll-snap-type

Enables scroll snapping along a specified axis.

Grammar: none | [ x | y | block | inline | both ] [ mandatory | proximity ]?. Inherited: False. Layout context: constrained scrolling box.

.sample { scroll-snap-type: x mandatory; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

scroll-snap-align

Chooses alignment of an item within a snapping container.

Grammar: [ none | start | end | center ]{1,2}. Inherited: False. Layout context: constrained scrolling box.

.sample { scroll-snap-align: start; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

overscroll-behavior

Controls scroll chaining at a scroll boundary.

Grammar: [ contain | none | auto ]{1,2}. Inherited: False. Layout context: block.

.sample { overscroll-behavior: contain; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

scrollbar-gutter

Reserves scrollbar space to reduce layout shifts where supported.

Grammar: auto | stable && both-edges?. Inherited: False. Layout context: block.

.sample { scrollbar-gutter: stable; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

flex-direction

Sets the main axis direction of a flex container.

Grammar: row | row-reverse | column | column-reverse. Inherited: False. Layout context: flex container.

.stage { flex-direction: column; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

flex-wrap

Allows multiple flex lines when items do not fit.

Grammar: nowrap | [ wrap | wrap-reverse ] || balance. Inherited: False. Layout context: flex container.

.stage { flex-wrap: wrap; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

flex-flow

Combines direction and wrapping.

Grammar: <'flex-direction'> || <'flex-wrap'>. Inherited: False. Layout context: flex container.

.stage { flex-flow: row wrap; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

justify-content

Distributes main-axis free space in Flexbox and alignment space in relevant contexts.

Grammar: normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]. Inherited: False. Layout context: flex container.

.stage { justify-content: space-between; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

align-items

Sets cross-axis alignment of items in supported layout contexts.

Grammar: normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ] | anchor-center. Inherited: False. Layout context: flex container.

.stage { align-items: center; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

align-content

Distributes lines/tracks when extra relevant space exists.

Grammar: normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>. Inherited: False. Layout context: flex container.

.stage { align-content: space-around; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

gap

Separates layout items or tracks without creating an outer margin.

Grammar: <'row-gap'> <'column-gap'>?. Inherited: False. Layout context: flex container.

.stage { gap: 20px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

row-gap

Sets separation between rows or flex lines.

Grammar: normal | <length-percentage>. Inherited: False. Layout context: flex container.

.stage { row-gap: 24px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

column-gap

Sets separation between columns or relevant flex items.

Grammar: normal | <length-percentage>. Inherited: False. Layout context: flex container.

.stage { column-gap: 24px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

flex

Combines grow, shrink and basis for a flex item.

Grammar: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]. Inherited: False. Layout context: flex item.

.sample { flex: 1 1 8rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

flex-grow

Controls an item’s share of positive free space.

Grammar: <number>. Inherited: False. Layout context: flex item.

.sample { flex-grow: 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

flex-shrink

Controls shrinking when negative free space must be distributed.

Grammar: <number>. Inherited: False. Layout context: flex item.

.sample { flex-shrink: 0; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

flex-basis

Sets a flex item’s initial main-size basis.

Grammar: content | <'width'>. Inherited: False. Layout context: flex item.

.sample { flex-basis: 12rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

order

Changes visual order in flex/grid; DOM reading order is unchanged.

Grammar: <integer>. Inherited: False. Layout context: flex item.

.sample { order: 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

align-self

Overrides cross-axis item alignment for this item.

Grammar: auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position> | anchor-center. Inherited: False. Layout context: flex item.

.sample { align-self: flex-end; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

justify-self

Aligns one item along the relevant inline axis; it does not apply to flex items.

Grammar: auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | anchor-center. Inherited: False. Layout context: grid item.

.sample { justify-self: end; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

place-items

Combines align-items and justify-items in supported contexts.

Grammar: <'align-items'> <'justify-items'>?. Inherited: False. Layout context: grid container.

.stage { place-items: center; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

place-content

Combines content alignment properties.

Grammar: <'align-content'> <'justify-content'>?. Inherited: False. Layout context: grid container.

.stage { place-content: center; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

place-self

Combines self-alignment properties for one item.

Grammar: <'align-self'> <'justify-self'>?. Inherited: False. Layout context: grid item.

.sample { place-self: center; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-template-columns

Defines explicit grid column tracks.

Grammar: none | <track-list> | <auto-track-list> | subgrid <line-name-list>?. Inherited: False. Layout context: grid container.

.stage { grid-template-columns: repeat(3,minmax(0,1fr)); }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-template-rows

Defines explicit grid row tracks.

Grammar: none | <track-list> | <auto-track-list> | subgrid <line-name-list>?. Inherited: False. Layout context: grid container.

.stage { grid-template-rows: 5rem auto; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-template-areas

Names rectangular areas in a grid template.

Grammar: none | <string>+. Inherited: False. Layout context: grid container.

.stage { grid-template-areas: "head head" "side main"; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-auto-columns

Sizes implicit columns created outside the explicit grid.

Grammar: <track-size>+. Inherited: False. Layout context: grid container.

.stage { grid-auto-columns: 8rem; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-auto-rows

Sizes implicit rows.

Grammar: <track-size>+. Inherited: False. Layout context: grid container.

.stage { grid-auto-rows: minmax(5rem,auto); }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-auto-flow

Controls automatic placement; dense can visually reorder items.

Grammar: [ row | column ] || dense. Inherited: False. Layout context: grid container.

.stage { grid-auto-flow: row dense; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-column

Places an item across grid column lines.

Grammar: <grid-line> [ / <grid-line> ]?. Inherited: False. Layout context: grid item.

.sample { grid-column: 1 / span 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-row

Places an item across grid row lines.

Grammar: <grid-line> [ / <grid-line> ]?. Inherited: False. Layout context: grid item.

.sample { grid-row: 1 / span 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-column-start

Sets the starting column line for an item.

Grammar: <grid-line>. Inherited: False. Layout context: grid item.

.sample { grid-column-start: 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-column-end

Sets the ending line/span for an item.

Grammar: <grid-line>. Inherited: False. Layout context: grid item.

.sample { grid-column-end: span 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-row-start

Sets the starting row line.

Grammar: <grid-line>. Inherited: False. Layout context: grid item.

.sample { grid-row-start: 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-row-end

Sets the ending row line/span.

Grammar: <grid-line>. Inherited: False. Layout context: grid item.

.sample { grid-row-end: span 2; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

grid-area

Combines row/column placement or references a named area.

Grammar: <grid-line> [ / <grid-line> ]{0,3}. Inherited: False. Layout context: grid item.

.sample { grid-area: 1 / 1 / 2 / 3; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

justify-items

Sets default inline-axis alignment for grid items.

Grammar: normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ] | anchor-center. Inherited: False. Layout context: grid container.

.stage { justify-items: stretch; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

object-fit

Fits replaced content into its content box, possibly cropping it.

Grammar: fill | contain | cover | none | scale-down. Inherited: False. Layout context: replaced image.

.sample { object-fit: cover; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

object-position

Positions replaced content within its box.

Grammar: <position>. Inherited: False. Layout context: replaced image.

.sample { object-position: center; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

list-style-type

Changes list marker appearance without changing list semantics.

Grammar: <counter-style> | <string> | none. Inherited: True. Layout context: list.

.sample { list-style-type: square; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

list-style-position

Places the marker inside the principal block box.

Grammar: inside | outside. Inherited: True. Layout context: list.

.sample { list-style-position: inside; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-collapse

Chooses a collapsed table-border model.

Grammar: separate | collapse. Inherited: True. Layout context: table.

table { border-collapse: collapse; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

border-spacing

Sets spacing between cells under the separate-border model.

Grammar: <length>{1,2}. Inherited: True. Layout context: table.

table { border-spacing: 12px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

table-layout

Uses a fixed table layout algorithm based on known widths.

Grammar: auto | fixed. Inherited: False. Layout context: table.

table { table-layout: fixed; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

caption-side

Positions a table caption at a block edge.

Grammar: top | bottom. Inherited: True. Layout context: table.

table { caption-side: bottom; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

empty-cells

Controls empty cell borders/backgrounds in the separate-border model.

Grammar: show | hide. Inherited: True. Layout context: table.

table { empty-cells: hide; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

transform-origin

Sets the origin used by transforms.

Grammar: [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?. Inherited: False. Layout context: block.

.sample { transform-origin: left top; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

transform-style

Allows descendants to participate in a 3D rendering context.

Grammar: flat | preserve-3d. Inherited: False. Layout context: block.

.sample { transform-style: preserve-3d; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson

perspective

Adds perspective for transformed descendants.

Grammar: none | <length>. Inherited: False. Layout context: block.

.sample { perspective: 600px; }

Why it matters: Using this property in its correct context helps explain actual computed results instead of guessing from appearance.

Common misunderstanding: A recognized declaration can still depend on context, content, fonts or browser support.

Related lesson