반응형
CSS 투명한 호버 효과
투명한 호버 효과
이 opacity속성은 종종 :hover 마우스 오버시 불투명도를 변경하기 위해 선택기 와 함께 사용됩니다 .
예
img {
opacity: 0.5;
filter: alpha(opacity=50); /* For IE8 and earlier */
}
img:hover {
opacity: 1.0;
filter: alpha(opacity=100); /* For IE8 and earlier */
}
<!DOCTYPE html>
<html>
<head>
<style>
img {
opacity: 0.5;
filter: alpha(opacity=50); /* For IE8 and earlier */
}
img:hover {
opacity: 1.0;
filter: alpha(opacity=100); /* For IE8 and earlier */
}
</style>
</head>
<body>
<h1>Image Transparency</h1>
<p>The opacity property is often used together with the :hover selector to change the opacity on mouse-over:</p>
<img src="img_forest.jpg" alt="Forest" width="170" height="100">
<img src="img_mountains.jpg" alt="Mountains" width="170" height="100">
<img src="img_fjords.jpg" alt="Fjords" width="170" height="100">
<p><b>Note:</b> In IE, a !DOCTYPE must be added for the :hover selector to work on other elements than the a element.</p>
</body>
</html>
Image Transparency
The opacity property is often used together with the :hover selector to change the opacity on mouse-over:
Note: In IE, a !DOCTYPE must be added for the :hover selector to work on other elements than the a element.
반응형
'IT > css' 카테고리의 다른 글
css Vertical Navigation Bar (0) | 2017.06.08 |
---|---|
css Navigation Bars (0) | 2017.06.08 |
CSS opacity 불투명도 / 투명성 (0) | 2017.06.05 |
CSS 레이아웃 - position: relative; 속성 (0) | 2017.03.13 |
css max-width and margin: auto; (0) | 2017.03.13 |