这将是我在Stackoverflow上的第一个问题,而且我对前端开发不是很有经验。我试图获得一个背景图像来覆盖整个页面,并使用div标签进行响应。我已经搜索了很多不同的解决方案,似乎没有任何工作,我迫切需要帮助。我如何使用div标签覆盖整个页面的背景图像?
这里是链接到该网站,所以你可以看到它现在的样子 http://mywebbapp170201.azurewebsites.net/
#header {
background-color: lightpink; /*Placeholder for now*/
background-image: url('Content/Pictures/weddingpicture.png');
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
max-width: none;
padding-bottom: 5vw;
margin-bottom: 10vh;
background-attachment: fixed;
}
<header id="header">
<div id="headerBanner">
<div><button type="button" id="closeBanner"><span class="fa fa-2x fa-times-circle"></span></button> <span id="bannerText">Är du en utställare? <a href="~/Home/ExhibitorsInfo">Klicka här!</a></span></div>
</div>
<div id="headerText">
<h2 class="text">Välkommen till</h2>
<h1 class="highlight">Bröllopsfeber!</h1>
</div>
<div id="headerDownBtn">
<div class="chevron" id="chevronStatic">
<a href="#down" target="_top"><span class="fa fa-3x fa-angle-down highlight"></span></a>
</div>
</div>
</header>