作者heavenbetula (绿草)
看板Web_Design
标题[问题] 关於後代选择器
时间Tue Nov 18 21:12:12 2014
小弟是自学的新手
在练习css後代选择器的部分有点问题
<style>
p a{background-color:red;}
</style>
<p>
<div>
<a href="
http://tw.yahoo.com.tw">练习</a>
</div>
</p>
为什麽a元素的背景没有变红色呢?
指定的元素间不管堆叠了几层,不是只要是後代就符合条件吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 36.231.163.170
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Web_Design/M.1416316334.A.563.html
1F:→ alog: 你只要记得,段落元素里面不该包 div 容器元素 11/18 21:28
2F:→ alog: 这 html code是错的,所以 css selector 的设定是套不上的 11/18 21:31
3F:→ heavenbetula: 原来如此...谢谢你! 11/18 22:14