我想爲我的網站的事件做一個像下面的框,但我卡住了。我該如何做這樣的模塊?
的問題,我不能解決:
- 減少圖像以相同的大小
- 創建相同大小的模塊
- 對齊模塊在同一行
.background {
\t width:360px;
\t height:200px;
}
.image{
\t width:100%;
\t height:100%;
}
.text {
\t width:100%;
\t height:25%;
\t color:#ffffff;
\t background:blue;
\t z-index: auto;
}
<div class="background">
<div class="image">
<img src="https://zero.eu/content/uploads/2017/01/Ryley_Walker-730x490.jpg" width="360" height="200" class="wp-image-156 hoverZoomLink" alt="Willie Peyote Live">
</div>
<div class="text">
<p>test test test</p>
</div>
</div>
怎麼樣使用zurb基礎,網站或Twitter的引導? afair,這兩個框架都包括類似的東西 – dizpers
我看你的代碼沒有問題。你在px中設置最大的div(class = background)一個固定的寬度和高度,其餘的元素都在這個裏面。要放在同一行中,請將「float:left」添加到背景類中。 您也可以嘗試:\t justify-content:left; \t align-items:left;位置是:固定; 認爲你也可以在後臺設置一個百分比,以製作一個大容器的背景。 –