文字有時會溢出各種瀏覽器尺寸的部分的「標籤」。 Here是該網站的鏈接。將文字懸停在圖片上
這裏是從代碼摘錄 -
HTML -
<div class="col-xs-12 col-md-4">
<div class="imgwrap">
<div class="service smooth">
<img src="https://s3.amazonaws.com/mrmerch.com/images/Apparel.svg" class="img-responsive" alt="Printed merchandise"><p class="imgdescription">Sample image description.</p>
</div>
</div>
<h4>Printed Apparel</h4>
</div>
CSS懸停 -
.imgdescription {
position: absolute;
top: 20%;
bottom: 50%;
left: 7%;
right: 7%;
background: transparent;
color: #fff;
visibility: hidden;
opacity: 0;
/*remove comment if you want a gradual transition between states
-webkit-transition: visibility opacity 0.2s;
*/
}
.imgwrap:hover img{
transition: all .5s ease-in;
transition: all .5s ease-out;
transform:scale(.95);
opacity: .05;
}
.imgwrap:hover .imgdescription {
visibility: visible;
opacity: 1;
transition: opacity .5s ease-in;
transition: opacity .5s ease-out;
font-size: 1.2em;
color: #000;
font-family: interstate-light,Helvetica, highway_gothic_wideregular, Arial, sans-serif;
}
Here is an example of what I'm seeing.
是的,問題是在小設備 – Manish62