그 호버 만 표시
뿐인 : http://jsfiddle.net/xz7xy8dg/
CSS :
.wrap {
position:relative;
display:inline-block;
}
.wrap::after {
position:absolute;
height: 100%;
width:100%;
top:0;
left:0;
background: -moz-linear-gradient(top, rgba(0,255,0,1) 0%, rgba(255,255,255,0) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,255,0,1)), color-stop(100%,rgba(255,255,255,0)));
background: -webkit-linear-gradient(top, rgba(0,255,0,1) 0%,rgba(255,255,255,0) 100%);
background: -o-linear-gradient(top, rgba(0,255,0,1) 0%,rgba(255,255,255,0) 100%);
background: -ms-linear-gradient(top, rgba(0,255,0,1) 0%,rgba(255,255,255,0) 100%);
background: linear-gradient(to bottom, rgba(0,255,0,1) 0%,rgba(255,255,255,0) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffffff',GradientType=0);
display:none;
content: ' ';
}
.wrap:hover::after {
display:block;
}
HTML :
<div class="wrap">
<img id="connectionRight_img" class="btn" src="imgs/trailEnd_turnRight.png" alt="Right Arrow"/>
</div>
이미지에 실제로있는 것 (PNG의 투명한 부분이 아님)이나 일반적인 버튼 영역에 그라디언트가 나타나기를 원하십니까? 후자의 경우 이것을 시도해보십시오 : http://jsfiddle.net/yvh32fub/ –
가능하면 PNG의 투명하지 않은 부분에 표시하고 싶습니다. – fia928
나는 실제로 다른 이미지 파일을 생성하고 그것을 원한다면 호버 (hover)에 스왑해야한다고 생각한다. 위에서 링크 된대로 CSS로 쉽게 할 수있는 전체 영역을 변경합니다. –