我有一个脚,它漂浮在我的div顶部。它在desktop
视图上运行良好,但在mobile
和tablet
分辨率上保持浮动。
问题-页脚在移动和平板分辨率的div上浮动。
我知道问题的原因,但我无法解决问题。原因是在页脚上方有一个浮动的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>
发布于 2015-10-12 21:05:29
有一个解决方案,即删除顶部: 50%,如果它是不重要的,但如果您只需要50%,而不是使用媒体查询。
@media screen and (max-width:750px)
{
.overflow
{
position:absolute;
top:0%;
}
}
因此,在桌面上,它会正常运行,移动尺寸低于750,而在750,它将是顶部和底部的页脚。
谢谢
https://stackoverflow.com/questions/33088937
复制