CSS Examples Highlight Image onMouseover (Opacity)
Author: CSS Drive
This example changes the opacity of any image link when the mouse moves over it using the "hover:" pseudo class of CSS. Note the two different properties used to specify opacity in CSS below. In IE 5.5+, the "filter" property is used (range: 0-100), and in Mozilla/NS6+, "-moz-opacity" (range: 0-1). Both properties are proprietary, and not formally endorsed by the W3C.
The HTML:
<a href="http://www.cssdrive.com/" class="highlightit"><img border="0"
src="test.gif"></a>
<a href="http://www.google.com/" class="highlightit"><img border="0"
src="test.jpg"></a>
The CSS:
.highlightit img{
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
-moz-opacity: 0.5;
opacity: 0.5;
}
.highlightit:hover img{
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);
-moz-opacity: 1;
opacity: 1;
}
Comments (26)
You don't really have to link the pics to anything. I used this style for < span > and it works just fine :)
is there a way to do this with valid css?
214 .highlightit img Parse Error - opacity=50)
215 .highlightit img Property -moz-opacity doesn't exist : 0.5
219 .highlightit:hover img Parse Error - opacity=100)
220 .highlightit:hover img Property -moz-opacity doesn't exist : 1
Thanks a lot for this. I am using it for my clients site. Too bad it wont validate. But great job
good sharing thansk
http://www.artiajans.net
please look this my job, as a problem.. :S
http://www.inadinagul.com
Forum
css Cursor examples , Properties , Attribute - - http://css-lessons.ucoz.com/cursor-css-examples.htm