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.
CKTIS / CSS
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
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.
The `.class` selector selects elements belonging to a named class. In HTML it matches an individual token in the `class` attribute, not a substring.
`::column` represents a multi-column container’s columns, primarily as targets for snapping during scrolling.
The ::cue pseudo-element styles WebVTT captions; its argument-taking form selects particular text fragments.
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.
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.
The selector `A B` matches an element `B` inside an ancestor `A`, regardless of how many levels deep it is nested.
The ::details-content pseudo-element styles the expandable portion of a details element without targeting its summary.
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".
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.
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.
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.
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.
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.
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.
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.
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.
:first-of-type selects the first element of its type among siblings, which is not necessarily its parent's first child.
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.
The :focus-visible pseudo-class matches a focused element when the browser determines that it should be visibly indicated.
The :focus-within pseudo-class matches an element with focus or a focused descendant, letting you highlight an entire control group.
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.
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.
The ::grammar-error pseudo-element styles text ranges that the browser has flagged as grammatically incorrect. It does not perform grammar checking itself.