How do I constrain opacity css to a singular image?

Here's a link to the page I'm working on:

http://www.ilovevegan.com/blog-2/

I want to have the opacity effect on the 4 images under the "Tags" section". I've managed to get the effect I want using this code:

<style type="text/css">

img

{

opacity:0.4;

filter:alpha(opacity=40); /* For IE8 and earlier */

}

img:hover

{

opacity:1.0;

filter:alpha(opacity=100); /* For IE8 and earlier */

}

</style>

But now I'm not sure how to get the effect to be applied to just the 4 images. How do I contain the css to a singular image?

Obviously I don't know anything about css, but any help would be greatly appreciated, thank you!

Comments

  • If they were in a div called "Tags" (with no other images), it would be as follows:

    <style type="text/css">

    #Tags img

    {

    opacity:0.4;

    filter:alpha(opacity=40); /* For IE8 and earlier */

    }

    #Tags img:hover

    {

    opacity:1.0;

    filter:alpha(opacity=100); /* For IE8 and earlier */

    }

    </style>

    If you have other images in that div I'd suggest creating a style that applies only to those images.

    ...

Sign In or Register to comment.