CSS @-Rules, an Overview
Post from September 11, 2017 (↻ September 17, 2020), filed under Web Development.
Did you know that @media
and @import
are the two most popular at-rules? (Are they? It’s just an educated guess, please correct me otherwise.) But what are the other at-rules, how many are there? I felt motivated to rummage through a few specs and confirm what’s there. A brief overview, a distant cousin of the much larger HTML elements and CSS properties indexes, one I’ll likewise keep up-to-date.
Name | Description | Status | Example |
---|---|---|---|
@charset |
“ |
REC |
|
@counter-style |
“ |
CR |
|
@font-face |
“ |
REC |
|
@import |
“ |
REC |
|
@keyframes |
“ |
WD |
|
@media |
“ |
REC |
|
@namespace |
“ |
REC |
|
@page and sub-rules * |
“ |
WD |
|
@property |
“ |
WD |
|
@scope |
“The @scope at-rule allows authors to create scoped style rules using CSS syntax.” |
WD |
|
@supports |
“[Test] whether the user agent supports CSS property:value pairs.“ | CR |
|
@viewport |
“ |
WD |
|
Missing here, for now, are @font-feature-values
and related at-rules. They’re being worked on in the Level 4 Fonts Module. I’ll extend this post once anything makes it to a more official status. @document
was also at one point considered, then, but got dropped.
* @page
has 16 sub-rules, from @bottom-center
to @top-right-corner
. I decided against listing them in the table because that seemed to reduce, not increase comprehension—after all, they’re all related to @page
, and all that differs is directionality. If you feel that these sub-rules are important to call out, or if you have suggestions around the matter, please email me.
About Me

I’m Jens Oliver Meiert, and I’m a web developer and author. I love trying things (including philosophy, art, and adventure). Here on meiert.com I share some of my views and experiences.
If you have a question or suggestion about what I write, please leave a comment (if available) or a message.
Read More
Have a look at the most popular posts, possibly including:

Perhaps my most relevant book: CSS Optimization Basics (2018). Writing CSS is a craft. As craftspeople we strive to write high quality CSS. In CSS Optimization Basics I lay out some of the most important aspects of such CSS. (Also available in a bundle with Upgrade Your HTML and The Web Development Glossary.)
Looking for a way to comment? Comments have been disabled, unfortunately.