如题!
5 回答
已采纳

guoyou
TA贡献28条经验 获得超30个赞
<div> <span> <p>1</p> </span> <p>2</p> <p>3</p> <p>4</p> </div> div>p选中了2 3 4 div p选中了1 2 3 4

问道_imooc
TA贡献6条经验 获得超2个赞
一个是子类选择器,一个是后代选择器。
div>p 是子类选择器,选择所有div的所有子元素中p元素(不包括孙子类元素)
div p 是后代选择器,选择所有div中所包含的所有p元素,包括孙子类元素

我是伍佳呀
TA贡献2条经验 获得超0个赞
div p 是包含选择器,可以选择div标签中的所有p标签
div>p 是子选择器,选择的是div标签中的儿子p标签(即直接包含在div标签中的p标签,p标签没有被包含在其他标签里)
- 5 回答
- 1 关注
- 5943 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消