大网数据广告活动
Web 标准与前端开发

CSS at-rule functions

· 52CE 我爱测

**CSS at-rule functions** are at-rule statements that represent complex rules or can invoke special data processing or calculations.

CSS at-rule functions are at-rule statements that represent complex rules or can invoke special data processing or calculations.

Syntax

@identifier function([argument]? [, argument]!) {
}

The syntax begins with the at symbol @ and an at-rule identifier, such as import. This is followed by the name of the at-rule function, such as url, followed by a pair of opening and closing parentheses. One or more arguments are specified inside the parentheses.

Some at-rule functions can take multiple arguments, which are formatted similar to CSS property values. White space is allowed, but it is optional inside the parentheses. Multiple arguments can be separated using a comma or a space.

@import functions

The @import at-rule is used to import styles from other stylesheets.

  • @import
    • : Imports a stylesheet file from the specified URL.
  • @import
    • : Imports a stylesheet file based on browser support.
  • @import layer()
    • : Imports a stylesheet file into the specified cascade layer.

@supports functions

The @supports at-rule checks for a browser's support for the specified CSS feature and then applies the CSS styling.

  • @supports
    • : Applies CSS rules after checking browser's support for the specified selector syntax.
  • @supports
    • : Applies CSS rules after checking browser's support for the specified font technology.
  • @supports
    • : Applies CSS rules after checking browser's support for the specified font format.

@namespace functions

The @namespace at-rule is used to specify XML namespaces to be used in a CSS stylesheet.

  • @namespace
    • : Defines XML namespace from the specified URL.

@container functions

The @container at-rule is used to specify styles for a containment context.

  • @container
    • : Defines the containment context style.

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。