iPad Safari 100%高度问题 [英] iPad Safari 100% height issue

查看:549
本文介绍了iPad Safari 100%高度问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的页面上有一个模态div,它灰化了背景。如果我将overlay div的高度设置为100%,它在IE(桌面)上可以正常工作,但在iPad Safari上,完整的高度不会变灰。究竟是什么问题?是与固定位置/视口做?请帮忙。下面是同样的CSS:

I have a modal div on my page, which grays out the background. If I set the height of overlay div to 100%, it works fine on IE (desktop), but on iPad Safari, the complete height is not grayed out. What exactly is the issue? Is it to do with fixed position/viewport? Please help. Below is the CSS for the same;

#TB_overlay {
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}
.TB_overlayBG {
    background-color: #000000;
    opacity: 0.4;
}


推荐答案

我怎么做是给最大高度宽度的覆盖。喜欢:

Hi the easiest way and that's how I do it is to give maximum height width to the overlay. Like:

.overlay{
 position: fixed;
 display: none;
 top: 0;
 left: 0;
 z-index: 99;
 width: 10000px;
 height: 10000px;
 opacity: 0.5;
 background: #ccc;
}

你可以把它放在底部,即 标记并将其显示更改为显然,无论你想要显示在它上面必须有一个更大的 z-index 。希望这可以帮助。如果您不明白,请告诉我们。

You can put this at the bottom i.e. before body tag and change its display to block whenever you want to gray out the background. Obviously whatever you want to show on top of it must have a greater z-index. Hope this helps. Let me know if you don't understand.

这篇关于iPad Safari 100%高度问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆