You can do this by using descendant selectors.
为此可使用后代选择器。
Use class selectors instead of descendant selectors.
使用class选择器代替后代选择器。
Avoid using descendant selectors, especially those that specify redundant ancestors.
避免使用后代选择器,特别是那些指定多余祖先的。
If you must use descendant selectors, prefer child selectors, which at least only require evaluation of one additional node, not all the intermediate nodes up to an ancestor.
如果您必须使用后代选择器,尽量使用子代选择器,这最少只需评估一个额外的节点,而非中间直至祖先的所有节点。
The selector in the following rule, which combines descendant and attribute selectors, matches any element that (1) has the "href" attribute set and (2) is inside a P that is itself inside a DIV
下面规则中的选择符结合了派生选择符和属性选择符,它匹配任何元素,如果(1)该元素设置了"href"属性;且(2)包含在一个P元素内,而P元素又包含在一个DIV元素内
The selector in the following rule, which combines descendant and attribute selectors, matches any element that (1) has the "href" attribute set and (2) is inside a P that is itself inside a DIV
下面规则中的选择符结合了派生选择符和属性选择符,它匹配任何元素,如果(1)该元素设置了"href"属性;且(2)包含在一个P元素内,而P元素又包含在一个DIV元素内
应用推荐