这个很普遍啦, 为了以后熟练使用, 我写了一小段代码, 反映了CSS中后代选择器的本质:
<html>
<head>
<style type="text/css">
.haha
{
font-size:100px;
}
.haha div
{
color:red;
font-size:50px;
}
</style>
</head>
<body>
<div class="haha">
I love you.
<div>I love you.</div>
<div style = "color:blue; font-size:25px">I love you.</div>
</div>
</body>
</html>
结果为:
I love you.
I love you.
I love you.