<!DOCTYPE html>
<html>
<head>
<style>
html {
position: relative;
min-height: 100%;
}
#footer {
height: 70px;
width: 100%;
background-color: black;
position: absolute;
bottom: 0;
}
#div1 {
width: 100%;
height: 100%;
height: 1500px;
background-color: slategrey;
}
</style>
</head>
<body>
<div id="div1">div1</div>
<div id="footer">footer</div>
</body>
</html>
如何在保证现在效果的情况下,去掉div1的height少于一屏的时候,div1还能占满全屏
慕尼黑5688855
相关分类