Image opacity (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


curious monkey -> Image opacity (6/5/2006 14:01:20)

here's my problem. I'm trying to get a opacity when the image is moused over here the CSS:
a.img:link {border:none;}
a.img:visted{border:none;}
a.img:hover{
filter:alpha(opacity=50); 
-moz-opacity: 0.5; 
opacity: 0.5;}

and the HTML
<a class="img" href="#"><img class="link" src="XYZ.JPG" align="left" alt="Sample"></a>


I'm stuck why this isn't working.[:(]




jaybee -> RE: Image opacity (6/5/2006 14:05:08)

Internet Explorer doesn't like opacity.




curious monkey -> RE: Image opacity (6/5/2006 14:08:25)

i forgot !!!! damned, @#$@ IE!

BUT this site where I was reading about it (i'm using IE) has it working fine... they prob got hacks... [:@]

site




rdouglass -> RE: Image opacity (6/5/2006 14:15:03)

quote:

Internet Explorer doesn't like opacity.


I have this on one of my sites and it works just fine in IE:

filter:alpha(opacity=30);
-moz-opacity: 0.3;
opacity: 0.3;

Doesn't look a whole lot different to me.

EDIT: I'm not using in on hover tho...




curious monkey -> RE: Image opacity (6/5/2006 14:19:04)

but it should work just fine as a hover... i can't figure out why its not working.[:@]




jaybee -> RE: Image opacity (6/5/2006 14:32:17)

I didn't say it doesn't work, just that IE doesn't like it and sometimes does odd things with it. I've been hunting around for this. Hope it helps.




rdouglass -> RE: Image opacity (6/5/2006 14:33:44)

Does it work if you use it inline?

Maybe there's an over-riding rule somewhere. I try them inline quickly just to rule that out.




curious monkey -> RE: Image opacity (6/5/2006 14:34:09)

that's the EXACT some page I was looking at.....[:)] look at the link I provided at the beginning.[;)]




curious monkey -> RE: Image opacity (6/5/2006 14:44:05)


quote:

ORIGINAL: rdouglass

Does it work if you use it inline?

Maybe there's an over-riding rule somewhere. I try them inline quickly just to rule that out.


but would I have to do the entire page as inline or can I just have a small section like this one div as inline?




jaybee -> RE: Image opacity (6/5/2006 14:48:32)

quote:

ORIGINAL: curious monkey

that's the EXACT some page I was looking at.....[:)] look at the link I provided at the beginning.[;)]


Oh rats. Sorry, fraught day.

Is it to do with you not having a width specified? Try pasting their example html and css into a page then tweak it to do what you want. You'll eventually be able to see exactly what you're doing that stops it working.




curious monkey -> RE: Image opacity (6/5/2006 14:50:18)

if it's a link why would I need a width?[8|]




jaybee -> RE: Image opacity (6/5/2006 14:52:26)

quote:

Notice that we added width:100%. That's because opacity only works with placement or layout specified (in IE).






Tailslide -> RE: Image opacity (6/5/2006 14:54:12)

This following code works locally for me:

a.img img {border:none;filter:alpha(opacity=100); -moz-opacity: 1.0; opacity: 1.0;}
a.img:hover img {border:none;filter:alpha(opacity=50);-moz-opacity: 0.5;opacity: 0.5;}




Don't ask me why but sometimes IE seems to need a kick start with a plain "a" rule rather than the psuedo "a:link" rule.




curious monkey -> RE: Image opacity (6/5/2006 15:03:25)

quote:

a.img img {border:none;filter:alpha(opacity=100); -moz-opacity: 1.0; opacity: 1.0;}
a.img:hover img {border:none;filter:alpha(opacity=50);-moz-opacity: 0.5;opacity: 0.5;}


Thank you all for your responses. [sm=bowdown.gif]
Tail that worked perfectly [sm=yupi3ti.gif]

Is there any ideas why my code didn't work?

Bueller? Bueller?[:D]




jaybee -> RE: Image opacity (6/5/2006 15:07:20)

quote:

Is there any ideas why my code didn't work?


Don't ask me, I'm sufferring from a serious case of brain fry today. I managed to disappear an entire site! [&o]

If you have no answer by tomorrow I'll look at it again after a good night's sleep but I suspect it's as Tail says. She's usually right. (spit spit)




Tailslide -> RE: Image opacity (6/5/2006 15:08:54)

Anyone?.... Anyone?

Nope bugger-all real idea.

All I can think of is either:

1. Maybe you need to set the "off" opacity too
2. Kicking IE into action with the straight "a" rule for the link rather than the "a:link" rule.

But those would be guesses. And if guesses were ponies I'd own a pie factory.


(sorry about the pony thing)




curious monkey -> RE: Image opacity (6/5/2006 15:15:12)

quote:

And if guesses were ponies I'd own a pie factory


that must be a Brit thing because ponies and pie have nothing in common... bloody brits.[sm=rolleyes.gif]




Tailslide -> RE: Image opacity (6/5/2006 15:22:04)

quote:

ORIGINAL: curious monkey

quote:

And if guesses were ponies I'd own a pie factory


that must be a Brit thing because ponies and pie have nothing in common... bloody brits.[sm=rolleyes.gif]


[:D][:D] no they don't much here either - must be the husband's french relatives' influence rubbing off - they'll eat pretty much anything as long as they've got a decent bottle of wine with it!!




curious monkey -> RE: Image opacity (6/5/2006 15:23:11)

bloody drunken french! [sm=rolleyes.gif]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875