我有以下的HTML和CSS:如何使文本框與圖像重疊?
/*.fullrecent{
position: relative;
}*/
.recentimage {
position: relative;
float: left;
width: 50%;
height: 500px;
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
}
.whitebox {
background-color: white;
}
<div class="fullrecent">
<div class="recentconcert">
<img class="recentimage" src="https://i.scdn.co/image/8b0172dd313c66872cfd01288cffec136b3e13b2">
<div class="whitebox">Hello World!</div>
</div>
<div class="recentconcert">
<img class="recentimage" src="https://i.scdn.co/image/8b0172dd313c66872cfd01288cffec136b3e13b2">
<div class="whitebox">Hello World!</div>
</div>
<div class="recentconcert">
<img class="recentimage" src="https://i.scdn.co/image/8b0172dd313c66872cfd01288cffec136b3e13b2">
<div class="whitebox">Hello World!</div>
</div>
<div class="recentconcert">
<img class="recentimage" src="https://i.scdn.co/image/8b0172dd313c66872cfd01288cffec136b3e13b2">
<div class="whitebox">Hello World!</div>
</div>
</div>
什麼我的目標做的是建立與這些照片,我可以做一個2×2矩陣,但它毀了的時候我試圖添加一個額外的功能,即添加一個白色矩形,每個圖像的底部從左端到右端重疊每個圖像。有人知道怎麼做嗎?
和解釋,而不是僅僅傾銷代碼做到這一點,通常預期(和樂於助人)。 – j08691