【发布时间】:2012-12-07 10:00:33
【问题描述】:
这是我的网页网址
在这个页面中,如果我们点击一个登录按钮,它将显示一个黑色背景的弹出屏幕。但是如果我们缩小页面,那么它会减小背景颜色的大小。但是如果我们缩小,我想覆盖整个屏幕的背景。我在我的页面中使用了下面的代码。
.black_overlay{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 2000%;
background-color: black;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
但在测试页面中,下面的代码用于覆盖整个背景。它工作正常。
<style type="text/css">
/*give the body height:100% so that its child
elements can have percentage heights*/
body{ height:100% }
/*this is what we want the div to look like*/
div.fullscreen{
display:block;
/*set the div in the top-left corner of the screen*/
position:absolute;
top:0;
left:0;
background-color: black;
/*set the width and height to 100% of the screen*/
width:100%;
height:100%;
color: white;
}
</style>
<div class="fullscreen">
<p>Here is my div content!!</p>
</div>
我怎样才能为我不知道的登录页面背景做同样的事情。任何人都可以帮我解决这个问题。
【问题讨论】:
-
如何放置登录表单的 div?是在桌子里面吗?
-
如果我将高度设置为 200%,它只会在标题上方停止背景。
-
建议:尽量避免这种情况:
40 requests❘855.30KB transferred|DOMContentLoaded: 1.9min
标签: javascript css styles