你會看到傢伙嗎?我的每個圖像底部都有一個帶標題的標題欄。但是對於所有的盒子來說這個高度不一樣所有我想要它會在所有框中的相同高度,如果你翻轉,那麼你會看到那個盒子滑動,很好。也會抵消。我仍然在嘗試,但無法想象它。你會猜猜看到我錯誤的地方嗎?我只是想讓這個完美。即使你有任何其他的css或js那樣的響應式支持,那麼請在這裏發帖。如何修復div位置
感謝
波紋管是用於說明在PX
.box {
float: left;
border: 1px solid #FFF;
margin: 2px;
position: relative;
overflow: hidden;
background-color: #F00;
}
.box img {
position:relative;
left: 0;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
}
.box .caption {
background-color: rgba(0, 0, 0, 0.8);
position: absolute;
color: #fff;
z-index: 100;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
left: 0;
text-align: left;
padding: 2%;
top: 92%;
height:96%;
}
.box:hover .caption {
-moz-transform: translateY(-89%);
-o-transform: translateY(-89%);
-webkit-transform: translateY(-89%);
opacity: 1;
transform: translateY(-89%);
}
我還沒有得到你的觀點??。 –
問題在於使用百分比(%),如果使用'px','.caption'可以具有相同的'height'。 – maketest