我試圖用圖像填充容器中標題下方的空間。問題在於圖像用圖像填充整個容器,而不是到達標題位置並停止。圖像填充整個div而不是隻填充標題下方的空間
這裏是我的代碼:
.container {
height: 100vh;
}
.showcase {
background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url(../img/innovative_background.jpeg);
background-position: center;
background-size: cover;
position: absolute;
width: 100%;
height: 100vh;
background-size: cover;
}
header {
background: rgba(255, 255, 255, 0);
min-height: 65px;
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100%;
z-index: 20;
transition: 0.35s all ease;
border-bottom: solid #cb5057;
}
<div class="container">
<header>
<ul>
<li>link1</li>
<li>Link 2</li>
<li>Link 3</li>
<li>Contact Us</li>
</ul>
</header>
<div class="showcase"></div>
</div>
我只是想圖像填充剩餘股利最多的頭元素。如果您有任何提示或解決方案,請告訴我。
謝謝!
你有容器高度100vh;並展示高度100vh;它會填滿整個容器當然.. – 1011sophie