弹出背景不需要屏幕高度的全部高度

Popup background not takes full height of screen height

本文关键字:高度 全部 屏幕 不需要 背景      更新时间:2023-09-26

我有一个弹出窗口它的背景没有完全显示出来我知道position:fixed是完全显示出来的但是我想让position:absolute在移动视图中完全覆盖屏幕但它不像height:100%height:auto只显示1/2屏幕背景而不是完全100%

我猜你是在寻找这样的东西:

.popup {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: tomato;
}
<div class="popup">I cover the whole screen!</div>

var windowObjectReference = window.open(strUrl, strWindowName, [strWindowFeatures]);
window.open(fullscreen=Yes);

,

记得在css中设置

html, body {
  height:100%;
}

否则,任何内容元素中的height:100%都不会覆盖整个屏幕,而是会受到限制,这个默认情况下不展开