CSS help with opacity for an image

  • 1 April 2016
  • 2 replies
  • 36 views

Hi Guys,

So im kinda new to front end work, Im just trying to change one of my images opacity, correct me if i’m wrong but shouldnt it just be:

#lp-pom-image-152 {
    opacity: 0.4;
    filter: alpha(opacity=40); /* For IE8 and earlier */
}

Nothing seems to happen when i input this in?

Pls help


2 replies

Userlevel 7
Badge +4

Hey Brad!

Yes you got it. Make sure to wrap your code like this:


#lp-pom-image-152 {
    opacity: 0.4;
    filter: alpha(opacity=40); /* For IE8 and earlier */
}

Hi there!
Is this still the best solution in Oct 2018?

Reply