--- title: Regra "At" slug: Web/CSS/At-rule tags: - AT - CSS - Referencia - Regra translation_of: Web/CSS/At-rule ---
{{cssref}}

Uma regra "at" is a CSS statement beginning with an at sign, '@' (U+0040 COMMERCIAL AT), followed by an identifier and includes everything up to the next semi-colon, ';' (U+003B SEMICOLON), or the next CSS block, whichever comes first.

/* General structure */
@IDENTIFIER (RULE);

/* Example: tells browser to use UTF-8 character set */
@charset "utf-8";

There are several at-rules, designated by their identifiers, each with a different syntax:

Regras de grupo condicionais

Much like the values of properties, each at-rule has a different syntax. Nevertheless, several of them can be grouped into a special category named conditional group rules. These statements share a common syntax and each of them can include nested statements—either rulesets or nested at-rules. Furthermore, they all convey a common semantic meaning—they all link some type of condition, which at any time evaluates to either true or false. If the condition evaluates to true, then all of the statements within the group will be applied.

Conditional group rules are defined in CSS Conditionals Level 3 and are:

Since each conditional group may also contain nested statements, there may be an unspecified amount of nesting.

Especificações

Especificação Estado Comentário
{{SpecName('CSS3 Conditional')}} {{Spec2('CSS3 Conditional')}} Initial definition
{{SpecName('Compat', '#css-at-rules', 'CSS At-rules')}} {{Spec2('Compat')}} Standardizes @-webkit-keyframes.

Consultar também: