내 포트폴리오에서 작업 중이며 내 이미지 미리보기 이미지에 멋진 것들을했습니다. 이제 호버 캡션이 호버에서 페이드 인/아웃되도록하고 싶습니다.CSS의 호버에 이미지 캡션이 희미 해짐
이것은 지금까지 제 코드입니다. HTML :
<a href="1.jpg" class="mask"><img src="1.jpg" />
<span class="caption fade-caption">
<h3>Fade Caption</h3>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit,sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
</span>
</a>
CSS는 :
.mask {
position:relative;
height:180px;
width:240px;
-webkit-box-shadow:0 0 1px #000;
border:5px solid #f6f6f6;
overflow:hidden;
float:left;
margin:15px;
}
.mask img {
position:absolute;
height:300px;
width:400px;
-webkit-transform: rotate(15deg);
-moz-transform:rotate(15deg);
-o-transform:rotate(15deg);
-ms-transform:rotate(15deg);
transform:rotate(15deg);
top:50%;
left:50%;
margin-top:-150px; /* half the height */
margin-left:-200px; /*half the width */
}
.mask:last-child {
margin-right:0px;
}
.mask .caption {
background-color: rgba(222,169,188,0.9);
position: absolute;
color: #fff;
z-index: 100;
left: 0;
}
.mask .fade-caption {
opacity: 0;
width: 220px;
height: 180px;
text-align: left;
padding: 4px 20px 4px 15px;
display:none;
font-size:0.8em;
}
.mask:hover .fade-caption {
opacity: 1;
display:inline;
width: 220px;
height: 180px;
-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;
}
나는 페이드 자막 클래스를 추가하고의 전환을 넣어 필요하다고 생각 : 상태를 가져,하지만 분명히 그건 옳지 않아. 나는 전환에 대해 아직 숙련되지 않았기 때문에 내 문제를 해결하는 데 도움이되는 튜토리얼을 찾을 수 없기 때문에 누군가가 나를 도울 수 있기를 바라고 있습니다.