이미지 위로 마우스를 가져갈 때 색상 오버레이 (및 이미지)가 표시되는 데 어려움을 겪고 있습니다.
기본적으로 사용자는이 오버레이를 볼 수 있어야합니다 (아래 2에서 구분됨).
다음 HTML 스 니펫이 있습니다.
<ul id="Grid">
<li class="mix category_1 mix_all" style="display: inline-block; opacity: 1;">
<img src="http://i.imgur.com/J4PaouI.jpg" alt="#">
</li>
</ul>
다음은 특정 CSS (그리고 확실히하기 위해 Z- 색인)입니다.
.mix_all:hover {
background: url(http://i.imgur.com/0lu7dWs.png) no-repeat center !important;
background-color: #de6573 !important;
z-index: 99999999;
}
#Grid .mix {
width: 200px;
height: 200px;
margin-bottom: 20px;
}
.mix.mix_all img {
max-height: 200px;
max-width: 200px;
}
다음은 바이올린에 대한 링크입니다.
올바른 버전은 다음과 같습니다. http://jsfiddle.net/maximgladkov/b2twr/1/
추가 요소를 추가 position: absolute
하고 표시해야합니다.
<ul id="Grid">
<li class="mix category_1 mix_all">
<img src="http://i.imgur.com/J4PaouI.jpg" alt="#" />
<div class="overlay"></div>
</li>
</ul>
.mix_all {
position: relative;
}
.mix_all .overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.mix_all:hover .overlay {
background: url(http://i.imgur.com/0lu7dWs.png) no-repeat center !important;
background-color: #de6573 !important;
z-index: 99999999;
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다