css - body, html 父div 都设置了height: 100%, 子元素也设置了,为什么高度还是内容高度?
PHPz
PHPz 2017-04-17 14:24:10
0
2
409

<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;
PHPz
PHPz

学习是最好的投资!

reply all(2)
伊谢尔伦

Try removing min-height

洪涛

Should the left and right p be used for floating, positioning or flex?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!