Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

Knowledge base — CSS

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 899

CSS

:visited — visited-link pseudo-class

The :visited pseudo-class styles visited hyperlinks. Its behavior depends on browser history and privacy protections.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

:where() — matching without adding specificity

The :where() pseudo-class matches elements against a selector list, but contributes zero specificity, including its arguments. It helps create easy-to-override base styles.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

:xr-overlay — the active WebXR DOM overlay root

The :xr-overlay pseudo-class matches the DOM overlay element during an immersive WebXR session, allowing interface styling without manually toggling a class.

Advanced · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

CSS comments

A CSS comment uses /* ... */ and can span multiple lines. Use comments to explain code or temporarily disable declarations, but remember that comments cannot be nested.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

CSS syntax: rules and declarations

Learn the distinction between a CSS qualified rule and a declaration: the selector identifies elements, while declarations inside the block specify properties and values. Also see how the browser handles an invalid value.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

Inspecting and editing CSS in DevTools

The CSS DevTools inspector lets you examine a selected element’s CSS rules and test changes in the browser. Learn to distinguish declarations in Styles from values in Computed, then transfer checked fixes to your source files.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

cap — the capital-height unit

The cap unit measures the selected font’s capital height. It lets an element’s dimensions follow typography rather than font-size alone.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

ch — a length unit based on the zero glyph

The ch unit measures length relative to the advance measure of the 0 glyph in the font being used. It helps size text-based layouts but does not represent a count of arbitrary characters.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

cm — CSS centimeter

cm is an absolute CSS length unit representing centimeters. The fixed relationship is 2.54cm = 96px, but this does not guarantee agreement with a physical ruler on screen.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

cqb — container block-size unit

The cqb unit expresses a length relative to a query container’s block size, which is not always its height.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

cqh — container height unit

The cqh unit expresses lengths relative to an eligible container’s height rather than directly relative to the browser viewport.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

cqi — container-relative inline-size unit

The cqi unit represents 1% of a container’s inline size. It lets elements scale relative to their container rather than the entire viewport.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

cqmax — the larger container-relative unit

The cqmax length unit selects the larger of 1cqi and 1cqb. It scales an element relative to container dimensions, with a container selected independently for each axis.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

cqmin — the smaller container unit

The cqmin length unit equals the smaller of 1cqi and 1cqb. It lets dimensions scale relative to containers rather than only relative to the viewport.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate; example verification recorded, browser execution not explicitly documented
CSS

cqw — container width unit

The cqw unit represents 1% of the width of the nearest eligible query container, which is not necessarily the parent.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

deg — degrees of an angle

The deg unit expresses CSS angles in degrees: 360deg is a full turn and 90deg is a quarter turn. Use it where the syntax accepts the <angle> type.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

dpcm — dots per centimeter

The CSS unit dpcm expresses resolution in dots per centimeter. It is used in contexts such as resolution media queries, rather than for specifying element lengths.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

dpi — resolution unit

The dpi unit measures dots per CSS inch. It belongs to the <resolution> type, not the length type, and can be used to query pixel density in media queries.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

dppx — resolution unit

The dppx unit describes the number of dots per CSS pixel. It belongs to the <resolution> type, not to length units; 1dppx equals 96dpi.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

dvh — dynamic viewport height

The dvh unit equals 1% of the dynamic viewport height, accounting for browser interface elements that expand and retract.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

dvmax — the larger dynamic viewport dimension

The dvmax length unit equals 1% of the larger dynamic viewport dimension: its width or height.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

dvmin — the smaller dynamic viewport dimension

The dvmin length unit represents 1% of the smaller dynamic viewport dimension. It accounts for browser interfaces expanding and retracting.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

dvw — dynamic viewport width

The dvw unit equals 1% of the dynamic viewport width. It sizes lengths against space that accounts for browser interfaces that expand and retract.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
CSS

em — a font-size-relative length unit

The em unit expresses a length relative to computed font-size. In font-size it uses the parent's size; in properties such as padding it uses the element's own size.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required