概述 CSS元素选择器(也称为类型选择器)通过node节点名称匹配元素. 因此,在单独使用时,寻找特定类型的元素时,元素选择器都会匹配该文档中所有此类型的元素. 语法 元素 {样式声明 } 示例 CSS span { background-color: DodgerBlue; color: #ffffff; } HTML <span>Here's a span with some text.</span> <p>Here's a p with some text.</p> 效果 Here's a span with some text. Here's a p with some text. 规范 Specification Status Comment CSS Selectors Level 3 Recommendation No change CSS 2.1 Recommendation CSS 1 Recommendation 浏览器兼容性 Desktop Mobile Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari Basic support (Yes) (Yes) (Yes) (Yes) (Yes) Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Basic support ? ? ? ? ? ? See also