0
<div class="row">
<div class="container-a1">
<ul class="caption-style-1">
<li class="col-lg-3 col-sm-3 portfolio-item">
<img class="img-responsive" src="img/1.png" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Amazing Caption</h1>
<p>Whatever It Is - Always Awesome</p>
</div>
</div>
</li>
<li class="col-lg-3 col-sm-3 portfolio-item">
<img class="img-responsive" src="img/1.png" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Amazing Caption</h1>
<p>Whatever It Is - Always Awesome</p>
</div>
</div>
</li>
<li class="col-lg-3 col-sm-3 portfolio-item">
<img class="img-responsive" src="img/1.png" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Amazing Caption</h1>
<p>Whatever It Is - Always Awesome</p>
</div>
</div>
</li>
<li class="col-lg-3 col-sm-3 portfolio-item">
<img class="img-responsive" src="img/1.png" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Amazing Caption</h1>
<p>Whatever It Is - Always Awesome</p>
</div>
</div>
</li>
</ul>
</div>
</div>
<style>
.portfolio-item {margin:0; padding:0;}
.caption-style-1{
list-style-type: none;
margin: 0px;
padding: 0px;
}
.caption-style-1 li{
float: left;
padding: 0px;
position: relative;
overflow: hidden;
}
.caption-style-1 li:hover .caption{
opacity: 1;
}
.caption-style-1 img{
margin: 0px;
padding: 0px;
float: left;
z-index: 4;
}
.caption-style-1 .caption{
cursor: pointer;
position: absolute;
opacity: 0;
-webkit-transition:all 0.45s ease-in-out;
-moz-transition:all 0.45s ease-in-out;
-o-transition:all 0.45s ease-in-out;
-ms-transition:all 0.45s ease-in-out;
transition:all 0.45s ease-in-out;
}
.caption-style-1 .blur{
background-color: rgba(0,0,0,0.65);
height: 175px;
width: 292px;
z-index: 5;
position: absolute;
}
.caption-style-1 .caption-text h1{
text-transform: uppercase;
font-size: 24px;
}
.caption-style-1 .caption-text{
z-index: 10;
color: #fff;
position: absolute;
width: 293px;
height: 176px;
text-align: center;
}
</style>
我將懸停標題的教程轉換爲bootstrap。問題是網格樣式組合是響應式的,我似乎無法讓標題響應。我嘗試將高度和寬度設置爲100%,但這不起作用?有小費嗎?Bootstrap Make Image Hover Caption Responsive
謝謝你正是我需要的。 –
嗨Velibor,不客氣。你需要它有ul> li嗎?如果是這樣的話,可以使用ul> li而不使用div來完成,如果你真的需要這樣的話。我可以這樣做,如果你需要它,或者只是想這樣看。 – AngularJR