Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE7 and opacity troubles

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
Hi All,

The below css works great in FF, but the opacity setting in IE7 does not seem to work...there was a post here previously about this and checking the hasLayout property. Its set to true for this element (its a div)...

Anyone have any ideas or hacks to get this sucker working in ie7?


#cover {
width: 100%;
height: 100%;
min-height: 100%;
position: absolute;
top: 0;
left: 0;
background-color: Black;
filter:alpha(opacity=70);
opacity:.70;
z-index: -3;

}
TIA

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Don't use a negative zIndex... or just get rid of it all together.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Heres how I did it using IE7 (Note, it also works in Fire Fox...
Code:
<head>
<title>Transparency</title>
</head>

<body background="[URL unfurl="true"]http://www.chrismassey.co.uk/csstransbackground.jpg">[/URL]

<div style="width:250px;margin:0 auto;"> 
 
<span style="float:left;filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25;"><img src="[URL unfurl="true"]http://www.chrismassey.co.uk/csstrans.bmp"[/URL] width="50" height="50"></span>

<span style="float:left;filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;"><img src="[URL unfurl="true"]http://www.chrismassey.co.uk/csstrans.bmp"[/URL] width="50" height="50"></span>

<span style="float:left;filter:alpha(opacity=75);-moz-opacity:.75;opacity:.75;"><img src="[URL unfurl="true"]http://www.chrismassey.co.uk/csstrans.bmp"[/URL] width="50" height="50"></span>
 
<span style="float:left;filter:alpha(opacity=100);-moz-opacity:1.0;opacity:1.0;"><img src="[URL unfurl="true"]http://www.chrismassey.co.uk/csstrans.bmp"[/URL] width="50" height="50"></span>

</div>

you can view this example at
 
Chrismassey - with respect to the code that you pasted... what should the OP do do? Copy your code as the solution to his problem?

You have posted incomplete code that doesn't actually help the OP... and you give no advice on what may be causing the problem. On top of that, a solution has already been posted that addresses the EXACT problem and gives a reason for the fix (zIndex).

Please think about how your post relates to the problem being answered before answering. Otherwise we end up filling up the forum with irrelevant content.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Jeff,

There is nothing wrong with the code I posted. It isn't incomplete, except I haven't mentioned that I use a background picture, and 4 small images.

Yes, a solution was provided. If you read, I wrote "heres how I did it". There is nothing wrong with providing a second solution.

So sorry, I really don't know what you meant by your post. I have found my method useful, and anything useful isn't irrelevent. The only thing that is irrelevent is your comment, and now my comment. Really, come on now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top