首頁  >  問答  >  主體

css - body, html 父div 都设置了height: 100%, 子元素也设置了,为什么高度还是内容高度?

<html>

<body>
    <p>
        <p>左</p>
        <p>右</p>
    </p>
</body>

</html>

这样的结构
body, html 父p 都设置了height: 100%, 子元素也设置了height: 100%,
p左有效, 为什么p右的高度还是内容高度?

有什么样式会影响吗? 找不到原因.
右p只设置了这个样式

-webkit-transition: -webkit-transform .3s ease-in-out,margin .3s ease-in-out;
-moz-transition: -moz-transform .3s ease-in-out,margin .3s ease-in-out;
-o-transition: -o-transform .3s ease-in-out,margin .3s ease-in-out;
transition: transform .3s ease-in-out,margin .3s ease-in-out;
margin-left: 230px;
min-height: 100%;
z-index: 820;
PHPzPHPz2716 天前414

全部回覆(2)我來回復

  • 伊谢尔伦

    伊谢尔伦2017-04-17 14:26:10

    去掉min-height試試

    回覆
    0
  • PHP中文网

    PHP中文网2017-04-17 14:26:10

    左右p用的浮動還是定位還是flex呢?

    回覆
    0
  • 取消回覆