css如何在HTML页面的底部放置一个元素
这个问题在这里已经有了答案:
你的第一个div是200px,h标签大约需要200px,但你的屏幕尺寸大于400px,所以有空白,将底部0px添加到蓝色div
尝试一下
   <!doctype html>
    <html>
    <body>
    <div style="height:200px;background-color:red;">
    </div>
    <h1>Some other content</h1>
    <h1>Some other content</h1>
    <h1>Some other content</h1>
    <div style="position: fixed;left: 0px;bottom: 0px;width: 100%;background-color:blue;color:white">
        footer
    </div>
    </body>
    </html>
尝试这个
<!doctype html>
<html>
<body>
<div style="height:200px;background-color:red;">
</div>
<h1>Some other content</h1>
<h1>Some other content</h1>
<h1>Some other content</h1>
<div style="height:25px;bottom:0px;background-color:blue;color:white">
    footer
</div>
</body>
</html>
上一篇: css how to position an element at the bottom of the html page
