CSS ReferencesLesson #213

CSS At-rules

CSS at-rules are statements that instruct CSS on how to behave. Each at-rule

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-ruleDescription
@charsetSpecifies the character encoding used in the style sheet
@containerDefine styles for elements in container, depending on the container's size or style
@counter-styleLets you define your own counter styles
@font-faceSpecifies a custom font with which to display text
@font-palette-valuesAllows you to customize the default values of a font-palette
@importAllows you to import a style sheet into another style sheet
@keyframesControls the steps in an animation by defining styles for points along the animation sequence
@layerUsed to control how the CSS cascade layers evaluates the order of styles
@mediaApplies parts of a style sheet based on the result of one or more media queries
@namespaceDefines an XML namespace to be used in the style sheet
@pageCustomizes the dimension, orientation, and margins of printed pages
@propertyAllows 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
@scopeAllows you to select elements in specific DOM subtrees and target elements precisely without writing overly-specific selectors
@starting-styleDefines an element's starting styles before the element gets its first style update
@supportsUsed to test whether a browser supports a CSS feature