1
이미지가 있습니다. onhover 이미지가 변하고 border-radius가 사라집니다. 하지만 그 이미지와 함께 오버레이 배경을 원합니다.CSS 호버 : 호버 동안 이미지에 오버레이
이 코드를 사용해 보았습니다.
.team-member {
text-align: center;
margin-bottom: 50px;
}
.opacity_box{
width: 225px;
height: 225px;
background: rgba(0,0,0,0.6);
display: none;
position: absolute;
left: 27.5%;
top: 0;
}
.team-member img {
margin: 0 auto;
\t -webkit-transition: all .3s;
-moz-transition: all .3s;
transition: all .3s
}
.team-member img:hover {
border-radius:0%;
-webkit-transition: all .3s;
-moz-transition: all .3s;
transition: all .3s;
}
.team-member img:hover + .opacity_box {
display: block;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="team-member">
\t \t \t \t \t
<img src="https://blackrockdigital.github.io/startbootstrap-agency/img/team/1.jpg"
\t \t \t \t \t \t onmouseout="this.src='https://blackrockdigital.github.io/startbootstrap-agency/img/team/1.jpg'"
\t \t \t \t \t \t onmouseover="this.src='https://blackrockdigital.github.io/startbootstrap-agency/img/team/2.jpg'"
\t \t \t \t \t \t class="img-responsive img-circle" alt="">
<div class="opacity_box"></div>
\t \t \t \t \t
<h4>Kay Garland</h4>
<p class="text-muted">Lead Designer</p>
<ul class="list-inline social-buttons">
<li><a href="#"><i class="fa fa-twitter"></i></a>
</li>
<li><a href="#"><i class="fa fa-facebook"></i></a>
</li>
<li><a href="#"><i class="fa fa-linkedin"></i></a>
</li>
</ul>
</div>
감사합니다.
안녕하세요 텍스트와 이미지 아래 링크를 가지고있다. 그래서 솔루션을 적용 할 때 텍스트와 링크를 오버레이합니다. –
@ 리시 구조를 변경하기 때문에 오버레이의 부모에 대해 '위치 : 상대방'을 설정하는 위치를 잊지 마십시오. – Justinas
예 ...하지만 텍스트 위에 오버레이가 나타납니다. –