Jump to content

Recommended Posts

Posted

Hi,

 

I am trying to get a site to have transparancy with css... i can get it working fine in mozilla using -moz-opacity: .8; however when i try to use filter:alpha(opacity=80); in IE 5/6 nothing happens - no transparency :)

 

A sample bit of one of my div section's css is

 

>#Content 
{
filter:alpha(opacity=80);
-moz-opacity: .8;
margin:20px 50px 50px 220px;
padding:10px;
background-color:#49554E;
border:1px solid #A1A1A1;
}

 

the site is http://trident.chrisps.com

 

Any ideas anyone?? :(

Posted

Well in Internet Explorer it looks like your header transparancy is working. Transparancy is a hard thing still for CSS to pick up because in its nature it picks up whatever the parent CSS code is. After doing a Google search on the matter it sounds like CSS 3 might fix some of these issues but that's still a ways away.

 

After spending many hours knee deep in HTML myself the best thing to do is to move it around several places to see if you can get it working. It is working where you called it exact in the header's HTML so there's nothing wrong with your code there at least.

 

Hope this helps! :)

Posted

Oh I have this problem as well am trying out the filter:alpha(opacity=100); bit. The transparency is fine in mozilla. People tell me IE is bad at supporting transparencies. Is that true, I think it is because like I said firefox transparency is fine

Posted

Thanks for the reply - it is weird tho - a friends site who is using identical style sheets code (he is using my style sheet) has transparnecy fine, but my site does not :( (in the same browser)

 

When you view it, how do you know the header transparency is working?

 

If it is working, the logo and the header should be exactly the same colour. If it is not working, they should be different colours.

 

Also, the picture to the right should not be obscured by the content pane

 

Thanks :)

Posted

well i have been having a play around, and got a friend to help, and it would appear that for it to work in ie, you have to have width:something; in there.

 

In other words i can either get it to display properly in IE or Mozilla, so i will have to have a css sheet for each browser!

Posted
so i will have to have a css sheet for each browser!
You should be able to use the same style sheet for both browsers, if the only difference is the transparency. My understanding is that the browser will just ignore style sheet properties it doesn't understand. So you should be able to continue to use :
#Content

{

filter:alpha(opacity=80);

-moz-opacity: .8;

margin:20px 50px 50px 220px;

padding:10px;

background-color:#49554E;

border:1px solid #A1A1A1;

}

and it should work fine. I've done this with opacity before, and never had any problems (except it not showing up in certain browsers). ^_^

Posted

The problem is that it would appear for IE5/6 transparency to work, there must be a width and height declaration. While this is fine for IE5/6, mozilla forces the hight, so it does not display correctly :D

Posted

What about using the old Box Model Hack to specify a height for IE and then cancel it for everybody else?

 

... {

height:NNNpx;

voice-family: "\"}\"";

voice-family:inherit;

height:auto;

}

 

Just a thought ...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...