:visited — visited-link pseudo-class
The :visited pseudo-class styles visited hyperlinks. Its behavior depends on browser history and privacy protections.
CKTIS / CSS
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
The :visited pseudo-class styles visited hyperlinks. Its behavior depends on browser history and privacy protections.
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.
The :xr-overlay pseudo-class matches the DOM overlay element during an immersive WebXR session, allowing interface styling without manually toggling a class.
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.
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.
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.
The cap unit measures the selected font’s capital height. It lets an element’s dimensions follow typography rather than font-size alone.
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.
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.
The cqb unit expresses a length relative to a query container’s block size, which is not always its height.
The cqh unit expresses lengths relative to an eligible container’s height rather than directly relative to the browser viewport.
The cqi unit represents 1% of a container’s inline size. It lets elements scale relative to their container rather than the entire viewport.
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.
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.
The cqw unit represents 1% of the width of the nearest eligible query container, which is not necessarily the parent.
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.
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.
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.
The dppx unit describes the number of dots per CSS pixel. It belongs to the <resolution> type, not to length units; 1dppx equals 96dpi.
The dvh unit equals 1% of the dynamic viewport height, accounting for browser interface elements that expand and retract.
The dvmax length unit equals 1% of the larger dynamic viewport dimension: its width or height.
The dvmin length unit represents 1% of the smaller dynamic viewport dimension. It accounts for browser interfaces expanding and retracting.
The dvw unit equals 1% of the dynamic viewport width. It sizes lengths against space that accounts for browser interfaces that expand and retract.
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.