有没有CSS样式级联的列表? CSS float不会级联

时间:2014-03-17 10:44:02

标签: css

在以下示例中,子div onetwo拥有父级的font-style,但没有float样式。是否有一个列表,哪些样式应该级联,哪些不会?

Link to jsfiddle demo

<!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>

0 个答案:

没有答案