Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

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

Entries: 5788

CSS

:modal — modal-state pseudo-class

The :modal pseudo-class selects elements in a modal state, not merely visible or open elements. It can style a dialog opened with showModal() while distinguishing it from a dialog opened with show().

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

Selector nesting and the & selector

Native CSS nesting allows rules inside rules. The & selector refers to the elements matched by the parent rule.

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

Next-sibling combinator (+)

The selector A + B matches an element B immediately preceded by an element A with the same parent. Whitespace, text, and comments between the elements do not break this adjacency.

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

:not() — negation pseudo-class

The :not() pseudo-class selects elements that match none of the selectors in its argument list.

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

:nth-child() — selection by position

The :nth-child() pseudo-class selects elements by their position among siblings. It supports An+B patterns and optional filtering with of S.

Intermediate · CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
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