html - 页脚 float 在 div 之上

标签 html css twitter-bootstrap-3

我有一个浮在我的 div 顶部的页脚。它在 desktop View 上运行良好,但在 mobiletablet 分辨率下保持 float 。

Problem - the footer is floating over the div on mobile and tablet resolutions.

我知道问题的原因是什么,但我无法解决问题。原因是页脚上方有一个 float 的div。因为在其他页面中,页脚工作得很好。我在下面为其添加了 css

页面示例:

<div>
    <img />
</div>
<div class="overFlow">
    Floating div over the image. The footer is sitting here
</div>
<footer>
    This floats on mobile view and desktop view.
</footer>


<style>
    .overFlow {
        position: absolute !important;
        top: 50%;
        left: 0%;
    }
</style>

最佳答案

有一个解决方案,即如果它不重要,则从中删除 top:50% 但如果您只需要 50% 而不是使用媒体查询。

@media screen and (max-width:750px)
{
.overflow
{
position:absolute;
top:0%;
}
}

所以在桌面上它会正确出现,在 750 以下的移动尺寸中,在 750 时它会在顶部和底部的页脚。

谢谢

关于html - 页脚 float 在 div 之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33088937/

相关文章:

javascript - 如何使用 angularjs 或 jquery 将每个单击的按钮操作保存在 json 文件/对象中?

html - Bootstrap 连续添加图像拉伸(stretch) Logo ?

css - 当导航栏折叠时,如何使 Bootstrap 3 导航栏从下拉列表变为折叠?

javascript - 如何在使用鼠标指针移动 div 时平滑移动它?

jQuery attr() 不适用于移动 Safari

javascript - 获取以像素为单位的 COLUMN 宽度(来自百分比)

java - Tapestry 5 中 radio 的 CSS 样式

css - 根据每个浏览器中的屏幕分辨率将 div 放置到屏幕中心

html - 选择后无法接收 Angular 2 函数中的选项值

html - Bootstrap - 在弹出框内对齐选择和提交表单