在以下示例中,子div one
和two
拥有父级的font-style
,但没有float
样式。是否有一个列表,哪些样式应该级联,哪些不会?
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body > div {
float: left; /* not inherited by child div */
font-style: italic; /* is inherited by child div */
}
body > div > div {
/*float: left;*/ /* uncommenting this have let the child div have the correct style */
}
</style>
</head>
<body>
<div>
parent
<div>
one
</div>
<div>
two
</div>
</div>
</body>
</html>