gpt4 book ai didi

html - 如何在 IE 中将 div float 在屏幕底部?

转载 作者:太空宇宙 更新时间:2023-11-04 16:12:51 25 4
gpt4 key购买 nike

我希望在用户屏幕底部 float 一个 DIV 容器,它应该在用户滚动时始终 float

尝试使用:

position: fixed;
bottom: 0px;

这适用于 Firefox,但不适用于 IE!

关于如何让它在 IE 中工作的任何想法

更新,使用(引用自 http://tagsoup.com/cookbook/css/fixed/bottom/ ):

<html>
<body>
<style>
body
{
margin: 0;
padding: 0 0 8em 0;
color: #000;
background: #fff;
font-size: 1em;
}
div#fixedbox
{
overflow: auto;
width: 100%;
height: 8em;
position: absolute;
bottom: 0;
left: 0;
color: #000;
background: #ddd;
}
div#content
{
padding: 1em;
}

@media screen
{
body>div#fixedbox
{
position: fixed;
}
}

</style>


<div id="content" style="width: 500px; height: 1200px">dfdf</div>
<div id="fixedbox"> The quick brown fox is stuck in this box. </div>
</body>
</html>

但问题依旧..

谢谢阿卡什

最佳答案

div.content 之外的绝对定位元素将相对于视口(viewport)固定,div.content 内的绝对定位元素将正常运行。这适用于 Windows 上的 ie 5.0 及更高版本,并且是可用的最稳定的解决方案。

点击“开始播放”,查看源码,学习...

http://tagsoup.com/cookbook/css/fixed/bottom/

body
{
margin: 0;
padding: 0 0 8em 0;
}
div#fixedbox
{
overflow: auto;
width: 100%;
height: 8em;
position: absolute;
bottom: 0;
left: 0;
}
{
body>div#fixedbox
{
position: fixed;
}

关于html - 如何在 IE 中将 div float 在屏幕底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8046458/

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