CSS At-rules Reference
CSS At-rules
CSS at-rules are statements that instruct CSS on how to behave. Each at-rule begins with an @ followed by a name.
The table below shows the different at-rules in CSS:
At-rule | Description |
---|---|
@charset | Specifies the character encoding used in the style sheet |
@container | Define styles for elements in container, depending on the container's size or style |
@counter-style | Lets you define your own counter styles |
@font-face | Specifies a custom font with which to display text |
@font-palette-values | Allows you to customize the default values of a font-palette |
@import | Allows you to import a style sheet into another style sheet |
@keyframes | Controls the steps in an animation by defining styles for points along the animation sequence |
@layer | Used to control how the CSS cascade layers evaluates the order of styles |
@media | Applies parts of a style sheet based on the result of one or more media queries |
@namespace | Defines an XML namespace to be used in the style sheet |
@page | Customizes the dimension, orientation, and margins of printed pages |
@property | Allows you to define custom CSS properties directly in the stylesheet without having to run any JavaScript. This at-rule has data type checking and constraining, sets default values, and defines whether the property can inherit values or not |
@scope | Allows you to select elements in specific DOM subtrees and target elements precisely without writing overly-specific selectors |
@starting-style | Defines an element's starting styles before the element gets its first style update |
@supports | Used to test whether a browser supports a CSS feature |