Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I change the appearance of an html image during hover without a second image?

Tags:

html

css

image

Is there a way to change the appearance of an icon (ie. contrast / luminosity) when I hover the cursor, without requiring a second image file (or without requiring a hidden portion of the image)?

like image 532
Brent Avatar asked Nov 28 '22 05:11

Brent


1 Answers

Here's some good information about image opacity and transparency with CSS.

So to make an image with opacity 50%, you'd do this:

<img src="image.png" style="opacity: 0.5; filter: alpha(opacity=50)" />

The opacity: part is how Firefox does it, and it's a value between 0.0 and 1.0. filter: is how IE does it, and it's a value from 0 to 100.

like image 199
Paige Ruten Avatar answered Dec 18 '22 08:12

Paige Ruten