e01.org

CSS at-rules

At-rules are CSS statements that instruct CSS how to behave. They are used to group and structure style rules and other at-rules, declare style information not directly associated with selected content, and manage syntactic constructs such as imports and namespaces keyword mappings. They begin with an at-sign, @ (U+0040 COMMERCIAL AT), followed by an identifier.

**At-rules** are [CSS statements](/docs/Web/CSS/Guides/Syntax/Introduction#css_statements) that instruct CSS how to behave. They are used to group and structure style rules and other at-rules, declare style information not directly associated with selected content, and manage syntactic constructs such as imports and namespaces keyword mappings. They begin with an at-sign, `@` (U+0040 COMMERCIAL AT), followed by an identifier.

## Index of at-rules and at-rule descriptors

- @charset
- @color-profile
- @container
- @counter-style
- @counter-style/additive-symbols
- @counter-style/fallback
- @counter-style/negative
- @counter-style/pad
- @counter-style/prefix
- @counter-style/range
- @counter-style/speak-as
- @counter-style/suffix
- @counter-style/symbols
- @counter-style/system
- @custom-media
- @document
- @font-face
- @font-face/ascent-override
- @font-face/descent-override
- @font-face/font-display
- @font-face/font-family
- @font-face/font-feature-settings
- @font-face/font-stretch
- @font-face/font-style
- @font-face/font-variation-settings
- @font-face/font-weight
- @font-face/line-gap-override
- @font-face/size-adjust
- @font-face/src
- @font-face/unicode-range
- @font-feature-values
- @font-feature-values/font-display
- @font-palette-values
- @font-palette-values/base-palette
- @font-palette-values/font-family
- @font-palette-values/override-colors
- @function
- @import
- @keyframes
- @layer
- @media (see [list of media features](#index_of_media_features) in the next section)
- @namespace
- @page
- @page/page-orientation
- @page/size
- @position-try
- @property
- @property/inherits
- @property/initial-value
- @property/syntax
- @scope
- @starting-style
- @supports
- @view-transition

## Index of media features

- @media/-moz-device-pixel-ratio
- @media/-webkit-animation
- @media/-webkit-device-pixel-ratio
- @media/-webkit-transform-2d
- @media/-webkit-transform-3d
- @media/-webkit-transition
- @media/any-hover
- @media/any-pointer
- @media/aspect-ratio
- @media/color
- @media/color-gamut
- @media/color-index
- @media/device-aspect-ratio
- @media/device-height
- @media/display-mode
- @media/dynamic-range
- @media/forced-colors
- @media/grid
- @media/height
- @media/horizontal-viewport-segments
- @media/hover
- @media/inverted-colors
- @media/monochrome
- @media/orientation
- @media/overflow-block
- @media/overflow-inline
- @media/pointer
- @media/prefers-color-scheme
- @media/prefers-contrast
- @media/prefers-reduced-data
- @media/prefers-reduced-motion
- @media/prefers-reduced-transparency
- @media/resolution
- @media/scan
- @media/scripting
- @media/shape
- @media/update
- @media/vertical-viewport-segments
- @media/video-dynamic-range
- @media/width

## Specifications

## See also

- [CSS at-rule functions](/docs/Web/CSS/Reference/At-rules/At-rule_functions)
- [Nesting at-rules](/docs/Web/CSS/Guides/Nesting/At-rules)
- [CSS syntax](/docs/Web/CSS/Guides/Syntax) module
- [CSS conditional rules](/docs/Web/CSS/Guides/Conditional_rules) module

source: MDN Web Docs mirror · page

Cite this

"CSS at-rules". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·