CSS At-rules
Browse all CSS at-rules with syntax, examples, and practical developer notes.
24 entries
@apply
Applies a set of CSS custom property values as a mixin — a draft feature inspired by Tailwind-style utilities.
@charset
Specifies the character encoding of the stylesheet.
@color-profile
Defines a custom color profile that can be referenced in CSS color functions.
@container
Applies styles based on the size of a containing element rather than the viewport.
@counter-style
Defines custom counter styles for use with CSS lists and counters.
@custom-media
Defines named media query aliases for reuse across stylesheets.
@document
Applies styles only when the document matches a specific URL — a deprecated Firefox-only feature.
@font-face
Defines a custom font to be loaded and used in the document.
@font-feature-values
Defines named aliases for OpenType font features, used with font-variant-alternates.
@font-palette-values
Overrides the colors in a color font's built-in palette.
@import
Imports an external CSS file or layer into the current stylesheet.
@keyframes
Defines the intermediate steps in a CSS animation sequence.
@layer
Declares a cascade layer, giving explicit control over the order of style precedence.
@media
Applies styles conditionally based on device characteristics like screen width, resolution, or orientation.
@namespace
Defines XML namespaces for use in CSS selectors, primarily for SVG and MathML.
@page
Modifies the margins, orientation, and size of printed pages.
@position-try
Defines fallback positioning options for anchor-positioned elements when they overflow their container.
@property
Registers a custom CSS property with a defined type, initial value, and inheritance behavior.
@scope
Limits the scope of CSS rules to a specific subtree of the DOM.
@scroll-timeline
Links a CSS animation to the scroll position of a scroll container.
@starting-style
Defines the initial styles of an element before its first style transition, enabling entry animations without JavaScript.
@supports
Applies styles only if the browser supports a specific CSS property or value.
@view-transition
Configures view transitions between pages or states in a document.
@viewport
Controls viewport settings directly in CSS — a deprecated alternative to the HTML meta viewport tag.