为什么我的外包装 DIV 不再覆盖整个浏览器 window?
Why is my outer wrapper DIV no longer covering the entire browser window?
除了the homepage:
,我网站上的每个页面在以下方面似乎都很好
背景图像设置在外包装内以固定并覆盖window。
#outerWrapper{
background-image:url("https://glutenfreeradio.co/assets/img/background.jpg");
background-position:center center;
background-size:cover;
background-attachment:fixed;
background-repeat:no-repeat;
position:absolute;
min-width:100%;
width:100%;
min-height:100%;
z-index:1
}
问题似乎不在于背景图像异常,而在于外包装不再像以前那样覆盖整个 window。但我终其一生都无法弄清楚为什么外包装纸不再覆盖整个 window 以及如何让它再次覆盖。
您应该将 min-height
设置为 100vh
而不是 100%
。有关详细信息,请参阅 here。
除了the homepage:
,我网站上的每个页面在以下方面似乎都很好背景图像设置在外包装内以固定并覆盖window。
#outerWrapper{
background-image:url("https://glutenfreeradio.co/assets/img/background.jpg");
background-position:center center;
background-size:cover;
background-attachment:fixed;
background-repeat:no-repeat;
position:absolute;
min-width:100%;
width:100%;
min-height:100%;
z-index:1
}
问题似乎不在于背景图像异常,而在于外包装不再像以前那样覆盖整个 window。但我终其一生都无法弄清楚为什么外包装纸不再覆盖整个 window 以及如何让它再次覆盖。
您应该将 min-height
设置为 100vh
而不是 100%
。有关详细信息,请参阅 here。