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

Child combinator (>)

The > combinator selects elements that are direct children of a specified parent. A > B matches B only when its parent matches A; it does not include descendants nested further down.

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

Class selector

The `.class` selector selects elements belonging to a named class. In HTML it matches an individual token in the `class` attribute, not a substring.

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

::column — column pseudo-element

`::column` represents a multi-column container’s columns, primarily as targets for snapping during scrolling.

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

::cue — styling WebVTT captions

The ::cue pseudo-element styles WebVTT captions; its argument-taking form selects particular text fragments.

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

:default — default form elements

The :default pseudo-class selects default interface elements, not necessarily the currently selected ones. It can highlight the default choice even after the user changes their selection.

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

:defined — the defined-element pseudo-class

The :defined pseudo-class selects elements considered defined by the document language. In HTML, it matches ordinary built-in elements and successfully constructed custom elements, allowing you to distinguish a component awaiting its definition from one that has been upgraded.

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

Descendant combinator

The selector `A B` matches an element `B` inside an ancestor `A`, regardless of how many levels deep it is nested.

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

::details-content — expandable content

The ::details-content pseudo-element styles the expandable portion of a details element without targeting its summary.

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

:dir() — directionality pseudo-class

The :dir() pseudo-class selects elements by directionality established through HTML rules, not the CSS direction property. It distinguishes ltr from rtl and accounts for inheritance and dir="auto".

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

:disabled — disabled-element pseudo-class

The :disabled pseudo-class selects elements that are actually disabled under HTML rules, not just elements carrying a disabled attribute. It lets you style a control's state but does not itself disable the control.

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

:empty — selecting empty elements

The :empty pseudo-class tests an element’s structure, not its appearance. Comments do not prevent matching, but child elements or text can. For whitespace, distinguish the rules in Selectors Level 3 from the Level 4 draft.

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

:enabled — elements in the enabled state

The :enabled pseudo-class selects elements that support an enabled state and are not disabled. It is not equivalent to lacking a disabled attribute or allowing value editing.

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

::file-selector-button — styling the file picker button

The `::file-selector-button` pseudo-element styles the button that opens the file picker in `input[type="file"]`. It targets only that button, not the whole control or the file picker dialog.

Basic · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate
CSS

:first — first printed page

The :first page pseudo-class selects the first page of a document in paged layout, such as printing. Use it in an @page selector to give the first page a separate margin without changing subsequent pages.

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

:first-child — the first element among siblings

The :first-child pseudo-class matches an element that comes first among its element siblings. It does not mean “the first element of this type”: p:first-child will not match a paragraph preceded by a heading.

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

::first-letter — the first letter of text

The ::first-letter pseudo-element styles the first letter on the first formatted line, for example by changing its color or font size. The :first-letter spelling is a backward-compatible form of the same pseudo-element.

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

::first-line — the first formatted line

The ::first-line pseudo-element styles the first line of content after the browser lays out the text. Its scope depends on line breaking, not source-code lines. The :first-line spelling is an older, equivalent syntax.

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

The :first-of-type pseudo-class

:first-of-type selects the first element of its type among siblings, which is not necessarily its parent's first child.

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

:focus — the focused element

The :focus pseudo-class matches an element that has focus: the recipient of input, such as keyboard input. It lets you highlight a focused form field, but does not itself move focus or make an element capable of receiving it.

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

:focus-visible — conditional focus indicator

The :focus-visible pseudo-class matches a focused element when the browser determines that it should be visibly indicated.

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

:focus-within — focus on an element or its descendant

The :focus-within pseudo-class matches an element with focus or a focused descendant, letting you highlight an entire control group.

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

:fullscreen — an element in fullscreen state

The :fullscreen pseudo-class selects elements in fullscreen state. It lets you change their appearance during fullscreen presentation, but does not itself enter fullscreen mode.

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

:future — the future timeline pseudo-class

The :future pseudo-class identifies content after the current position on a host-defined timeline. In WebVTT, it styles future portions of an active cue through ::cue(:future); it does not select HTML elements that will be created later.

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

::grammar-error — highlighting grammatical errors

The ::grammar-error pseudo-element styles text ranges that the browser has flagged as grammatically incorrect. It does not perform grammar checking itself.

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