Link/Image opacity until hover


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. The CSS
  2.  
  3.  
  4. a.linkopacity img {
  5. filter:alpha(opacity=50);
  6. -moz-opacity: 0.4;
  7. opacity: 0.5;
  8. -khtml-opacity: 0.4;}
  9. a.linkopacity:hover img {
  10. filter:alpha(opacity=100);
  11. -moz-opacity: 1.0;
  12. opacity: 1.0;
  13. -khtml-opacity: 1.0; }
  14.  
  15.  
  16. Add the class "linkopacity" to the <a>
  17.  
  18. <a href="#" class="linkopacity"><img src="images/photo.jpg"></a>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.