导航
×
   ❮   
HTML CSS JavaScript PHP Go Sass W3C Colors ECMS

CSS * 选择器


实例

选择所有元素,并将它们的背景颜色设置为黄色

* {
    background-color: yellow;
}
亲自试一试 »

更多“自己尝试”的例子见下文。


定义和用法

The * selector selects all elements.

The * selector can also select all elements inside another element (See "More Examples").

版本 CSS2

浏览器支持

表格中的数字表示首次完全支持该选择器的浏览器版本。

选择器
* 4.0 7.0 2.0 3.1 9.6

CSS 语法

* {
    css declarations;

更多实例

实例

选择<div> 元素内的所有元素,并将它们的背景颜色设置为黄色

div * {
    background-color: yellow;
}
亲自试一试 »

Copyright ©2020-2026 freew3c.com All Rights Reserved 提供的内容仅用于学习和测试,不保证内容的正确性。