gpt4 book ai didi

css - 如何将 div 拉伸(stretch)到 100% 页面高度?

转载 作者:行者123 更新时间:2023-11-28 08:59:29 27 4
gpt4 key购买 nike

<html>
<head>
<style>
.100PercentHeight{ }
</style>

</style>

<body>
<div class='100PercentHeight'>hihi</div>
</body>
</html>

如何将 div 拉伸(stretch)到页面的 100% 高度?

最佳答案

尝试(它应该适用于大多数浏览器):

.100PercentHeight, html, body {
height : auto !important; /* Ignored by Internet Explorer, applied everywhere else. */
height : 100%; /* Internet Explorer treats as min-height. */
min-height : 100%; /* Internet Explorer ignores this. */
}

关于css - 如何将 div 拉伸(stretch)到 100% 页面高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/951712/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com