CSS Descendant Combinator ( )
- 上一页 子元素组合器
- 下一页 相邻兄弟组合器
- 返回上一层 Manwal ng Combiner ng CSS
Definition and Usage
CSS Descendant Combinator (A simple space
) is used to select elements within an element.
If the element matched by the second selector has an ancestor (parent element, parent's parent element, etc.) that matches the first selector, then these elements will be selected.
Example
Select and set the style of all <p> elements within the <div> elements:
div p { background-color: yellow; }
CSS Grammar
element1 element2 { css declarations; }
Technical Details
Version: | CSS1 |
---|
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
支持 | 支持 | 支持 | 支持 | 支持 |
相关页面
CSS 教程:CSS 后代选择器
- 上一页 子元素组合器
- 下一页 相邻兄弟组合器
- 返回上一层 Manwal ng Combiner ng CSS