我有一个弹出窗口,它的背景并没有达到完全高度我知道position:fixed
已完成高度,但我想在移动视图中将其position:absolute
取出并完全覆盖屏幕但是它不需要height:100%
或height:auto
只提供1/2屏幕背景而不是完全100%
答案 0 :(得分:2)
我想你是这样的:
.popup {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: tomato;
}

<div class="popup">I cover the whole screen!</div>
&#13;
答案 1 :(得分:1)
throw true;
答案 2 :(得分:0)
记得在css中设置
html, body {
height:100%;
}
否则,内容元素中的任何height:100%
都不会涵盖所有屏幕,但会受到限制,默认情况下不会扩展