Forum Moderators: not2easy

Message Too Old, No Replies

Need some help adapting some CSS coding.

         

ebally

12:20 am on Feb 14, 2005 (gmt 0)

10+ Year Member



I need some help adapting some CSS I got from a site to work with Internet Explorer on the Mac.

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

I followed the steps one by one and I got the code to work with all browsers I've tested it with so far, (except the Mac version of Internet Explorer).

The browser refuses to show the Tables background image, so I just end up with a fully transparent Table. (And not a 50% opacity background that i'm after).

Thank you in advance for any help you may give.

Hassan.

[edited by: tedster at 5:32 am (utc) on Feb. 14, 2005]

SuzyUK

10:09 am on Feb 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi ebally - Welcome to WebmasterWorld!

bump really as I don't know much about IE/Mac.. although I can tell you that support for CSS Opacity is definitely sketchy full stop. Opera for instance doesn't support it at all, and for IE you need to use proprietary filters, whether Mac supports those filters I don't know..

have you a snippet of the code you're using that works in IE to see if someone else can help more

Thanks
Suzy

jetboy

10:17 am on Feb 18, 2005 (gmt 0)

10+ Year Member



ebally, how are trying to achieve the translucency? 32 bit PNGs?

ebally

10:39 am on Feb 18, 2005 (gmt 0)

10+ Year Member



I am using transparent PNGs, but I cannot remember if they are 8bit or 32bit. Here is a copy of the source code:

<html>
<head>
<title> Testing Opacity. </title>

<style type="text/css">

body {
background: #ffffff url('Smilie.gif');
text-align: center;
}

#LayerDVD {
background: url('layer.png');
border: 3px solid #cccccc;
color: #ffffff;
height: 200px;
margin: 20px auto;
padding: 10px;
text-align: justify;
width: 300px;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='Layer.png');
}

</style>

</head>

<body>

<div id="LayerDVD">Testing.</div>

</body>
</html>

[edited by: SuzyUK at 10:46 am (utc) on Feb. 18, 2005]
[edit reason] fixed formatting [/edit]

jetboy

11:11 am on Feb 18, 2005 (gmt 0)

10+ Year Member



Hmm, not convinced I can actually help here ...

You know, I assume, that the alpha filter only works on PC IE, so you're not relying on that to work here.

That said, in my experience, to get tiled PNG backgrounds to work in Mac IE, the tiling image needs to by at least 64px x 64px (so 64px or greater in both dimensions), and any background repeat information needs to be part of a separate background-repeat declaration, not part of a background shorthand declaration.

Compatibility across browsers generally is better for 32-bit PNGs than 8-bit, so I'd stick with those if at all possible.

Edit: Could case sensitivity be an issue here? You have both Layer.png and layer.png referenced in your code.

ebally

11:28 am on Feb 18, 2005 (gmt 0)

10+ Year Member



Thank you for your help guys, I really do appreciate it.

I have managed to get the code to work in Mac IE (not transparent) but it still shows up, so it's better than nothing.

I have tested it in FireFox, Netscape, IE and Safari on the Mac. And the results are promising.

The next phase of the project is to tackle the PC side of things. So I was wondering if there was a way to post a URL here, so that people could access the page a tell me how it fairs on their browser? (Compaired to a screenshot of how it should look on the same page).

Hassan.

[edited by: SuzyUK at 7:41 pm (utc) on Feb. 22, 2005]
[edit reason] formatting [/edit]

createErrorMsg

1:51 pm on Feb 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



#LayerDVD {
background: url('layer.png');
border: 3px solid #cccccc;
color: #ffffff;
height: 200px;
margin: 20px auto;
padding: 10px;
text-align: justify;
width: 300px;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='Layer.png');
}

My understanding is that you have to remove the background image (bold above) while applying the IE filter in order to get png transparency in IE. Otherwise the filter image is transparent, but the background png underneath it is not, resulting in no transparency (A sheet of glass over a peice of wood does not a window-pane make.)

#LayerDVD { 
background: url('layer.png');
border: 3px solid #cccccc;
color: #ffffff;
height: 200px;
margin: 20px auto;
padding: 10px;
text-align: justify;
width: 300px;
}

/*iemac hide \*/
* html #LayerDVD{
background-image:none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='Layer.png');
}
/*end iemac hide*/

This, of course, is for IE/Win.

cEM

ebally

2:58 pm on Feb 18, 2005 (gmt 0)

10+ Year Member



Cheers again for the feedback guys.

I have inplemented the changes you talked about, but I have no idea whether it's working on Windows. Furthermore, I am back to square 1 with Mac IE not showing the background at all!

At this stage I would just settle for the background just to show up in Mac IE, and the background to be transparent in the rest of the browsers. (I really hate cross-platform scripting sometimes!)

Any help would be appreciated!

Hassan.

<No URLs, thanks. See TOS [WebmasterWorld.com] and CSS Forum Charter [WebmasterWorld.com]>

[edited by: SuzyUK at 7:39 pm (utc) on Feb. 22, 2005]

davidbraun

3:12 pm on Feb 18, 2005 (gmt 0)

10+ Year Member



I've been poking around with PNG-Backgrounds, too, and there are several painful workarorounds to get them to work with MSIE. If you're not relying on transparency (and thus need to implement the wokarounds), you can do as following (which work halfways, msie for mac doesn't seem to be sure wether it understands and supports it or not)

<style type="text/css">

div.withBg { background-image: url(/img/ugly.gif); }
body > div.withBg{ background-image: url(/img/beauty.png); }
/* MSIE does not understand the latter argument and thus ignores it, the rest do, and replace "ugly.gif" with "beauty.png" */

</style>

<div class="withBg">mmmm, something...</div>

BTW: This MSIE-only code you're using _should_ be working on both the mac and the windows-platform, but it seems to be a major performance eater (I tested with virtual-PC, so I can only make assumptions here...)