navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Image opacity

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Image opacity
Page: [1]
 
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
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.:)

_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.
jaybee

 

Posts: 14122
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: Image opacity - 6/5/2006 14:05:08   
Internet Explorer doesn't like opacity.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to curious monkey)
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
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

_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.

(in reply to jaybee)
rdouglass

 

Posts: 9186
From: Biddeford, ME USA
Status: offline

 
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...

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to curious monkey)
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
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.:)

_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.

(in reply to rdouglass)
jaybee

 

Posts: 14122
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
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.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to curious monkey)
rdouglass

 

Posts: 9186
From: Biddeford, ME USA
Status: offline

 
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.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to curious monkey)
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
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.:)

_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.

(in reply to jaybee)
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
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?

_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.

(in reply to rdouglass)
jaybee

 

Posts: 14122
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
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.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to curious monkey)
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
RE: Image opacity - 6/5/2006 14:50:18   
if it's a link why would I need a width?:)


_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.

(in reply to jaybee)
jaybee

 

Posts: 14122
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
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).




_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to curious monkey)
Tailslide

 

Posts: 5972
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
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.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to jaybee)
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
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. :)
Tail that worked perfectly :)

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

Bueller? Bueller?:)

_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.

(in reply to Tailslide)
jaybee

 

Posts: 14122
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
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! :)

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)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to curious monkey)
Tailslide

 

Posts: 5972
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
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)

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to curious monkey)
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
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.:)

_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.

(in reply to Tailslide)
Tailslide

 

Posts: 5972
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
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.:)


:):) 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!!

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to curious monkey)
curious monkey

 

Posts: 543
Joined: 4/28/2006
From: The lower handle of US
Status: offline

 
RE: Image opacity - 6/5/2006 15:23:11   
bloody drunken french! :)

_____________________________

The way it is now, the asylums can hold all the sane people but if we tried to shut up the insane we should run out of building materials.

(in reply to Tailslide)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Image opacity
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts