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

:nth-last-child() — counting elements from the end

The :nth-last-child() pseudo-class selects elements by their position counted backwards among siblings. Optional of S filters elements before counting.

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

:nth-last-of-type() — position among same-type elements from the end

The :nth-last-of-type() pseudo-class selects elements by their position among siblings of the same type, counting from the end.

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

:nth-of-type() — position among elements of the same type

The :nth-of-type() pseudo-class selects an element by its position among siblings of the same type, rather than among all element siblings. It supports 1-based positions, An+B formulas, and the keywords odd and even.

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

:only-child — an element without siblings

The :only-child pseudo-class selects an element without element siblings. Text and comments do not affect matching, but hidden elements do.

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

:only-of-type — the only element of its type

The :only-of-type pseudo-class selects an element with no siblings of the same type. Siblings of other types do not prevent a match; classes and IDs do not determine type.

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

:open — elements in the open state

The :open pseudo-class selects elements in their defined open state. Use it to style expanded details, open dialog elements, and controls with an open drop-down or picker.

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

:optional — optional form controls

The CSS :optional pseudo-class selects form controls that do not require a value. It does not mean “any element without required” or “an empty field”: matching depends on the control type and HTML rules.

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

:out-of-range — a value outside its limits

The `:out-of-range` pseudo-class selects form controls whose value is below the lower limit or above the upper limit of their allowed range. In HTML, it applies to elements that participate in constraint validation and have range limitations; it does not represent every kind of invalid value.

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

::part() — styling exposed Shadow DOM elements

The ::part() pseudo-element lets outside styles target shadow-tree elements explicitly exposed by a component.

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

:past — past-element pseudo-class

The :past pseudo-class refers to earlier content on a timeline defined by the document language. In WebVTT, it can be used inside ::cue() to highlight a portion of an active cue once playback reaches the preceding timestamp, or from the start of the cue if there is no preceding timestamp. A match does not mean the portion has finished. It is not a selector for browsing history or dates.

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

::picker() — styling a popup picker

The ::picker() pseudo-element targets the popup portion of a form control. For select, select::picker(select) lets you style the dropdown panel separately from the closed control. Both the control and its picker must opt into basic appearance.

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

::picker-icon — picker opener icon

The ::picker-icon pseudo-element styles the icon indicating that a popup picker is available. It does not represent the options panel itself.

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

:picture-in-picture — picture-in-picture state

The :picture-in-picture pseudo-class matches an element whose contents appear in an overlaid picture-in-picture window. It styles the element in the document, not the window itself.

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

::placeholder — styling placeholder text

The ::placeholder pseudo-element selects hint text in a form field, not the field itself or its entered value. It lets you change the hint’s appearance independently of user-entered text.

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

:placeholder-shown — a control displaying a placeholder

The :placeholder-shown pseudo-class selects a control currently displaying its placeholder hint. It lets you change the appearance of the whole field rather than just the placeholder text.

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

:popover-open — selecting a showing popover

The :popover-open pseudo-class selects an element in its popover-showing state. It distinguishes that state from merely having the popover attribute, allowing styles to apply only while the popover is open.

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

:read-only — non-editable elements

The :read-only pseudo-class selects elements that are not user-editable under the document language’s rules. It is not equivalent to [readonly]: in HTML, it also matches ordinary paragraph elements and disabled fields. It does not match text nodes.

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

:read-write — user-editable elements

The :read-write pseudo-class selects elements whose contents the user can edit under HTML rules. It includes eligible form fields and editable content, but not every enabled control.

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

:required — required form controls

The CSS :required pseudo-class selects controls that HTML defines as required. It describes a requirement on a field, not whether its current value is valid or whether the field is empty.

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

:right — right-hand pages in @page

The :right page pseudo-class selects right-hand pages in paginated output, such as printing. Use it in @page, typically to define asymmetric page margins.

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

:root — the document root element

The :root pseudo-class selects the document’s root element. In an ordinary HTML document, that element is html, not body.

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

:scope — the selector’s reference element

The :scope pseudo-class identifies a selector’s scoping root. For example, it lets you select direct children of the element on which querySelectorAll() is called.

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

::scroll-button() — CSS scrolling controls

The ::scroll-button() pseudo-element provides a control that scrolls its associated container by one “page”. Its argument selects a direction, content generates the control, and :disabled identifies a scrolling boundary.

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

::scroll-marker — scroll navigation marker

The ::scroll-marker pseudo-element creates a control that, when activated, scrolls to its originating element or, if it originates from a ::column pseudo-element, to that column. It requires a marker group on a scroll container.

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