Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / See if I can stump you, IE 6 Transparency issue.

See if I can stump you, IE 6 Transparency issue.

Locked

Views: 2,440

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
3 Jul 2007, 1:53 PM
#1
irrugly avatar

irrugly

New Zenner

Join Date:
Apr 2007
Posts:
25
Plugin Contributions:
0

See if I can stump you, IE 6 Transparency issue.

Alright, im my css I made a .png image a background for my #contentWrapper. It has a transparent drop shadow on the edges to give the effect. It works fine in ie7 and ff. I cant get it to force transparency for ie6. Im not sure how to hack it or what kind of work around. Ive tried several different scripts. All my other transparencies work, that are on the page itself. Just not this one. any ideas?

3 Jul 2007, 2:00 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: See if I can stump you, IE 6 Transparency issue.

IE6 doesn't support png transparency. Sorry, just doesn't do it. One work around is to have a gif version and substitute that for visitors still using IE6.

3 Jul 2007, 6:38 PM
#3
irrugly avatar

irrugly

New Zenner

Join Date:
Apr 2007
Posts:
25
Plugin Contributions:
0

Re: See if I can stump you, IE 6 Transparency issue.

How would I add that in the stylesheet?

#mainWrapper {
background-image: url(../images/test.png);
background-repeat: repeat-y;
text-align: left;
width: 791px;
vertical-align: top;
border: 0px solid #000000;
}

Can you put a conditional in a stylesheet?

<!--[if IE 6]> blah blah <![endif]-->

any help would be greatly appreciated

3 Jul 2007, 7:08 PM
#4
irrugly avatar

irrugly

New Zenner

Join Date:
Apr 2007
Posts:
25
Plugin Contributions:
0

Re: See if I can stump you, IE 6 Transparency issue.

or would I need to find the file that tells zen-cart to load the stylesheets and put the conditional there? if ie6 load iestylesheet.css and in that stylesheet put that for #mainWrapper? just replace the file with a gif?

So I found the file html_header.php

" $directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');

while(list ($key, $value) = each($directory_array)) {

echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";

}"

etc etc. How would I add a conditional in there for ie6?

should I just wipe the code an add straight html lines loading the style sheets with the conditional? since I dont think im going to use separate stylesheets depending on the pages I shouldnt need it to search the directories for the css.

3 Jul 2007, 7:27 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: See if I can stump you, IE 6 Transparency issue.

You're on the right track (though no you can't put conditional HTML comments into a stylesheet), but there's an add-in mod for handling IE stylesheets that does the coding for you. Then you just need to put the one line of CSS into an appropriately named stylesheet (explained in the installation instructions) and place it in your template's CSS directory.

I think that the mod is in the Other Modules section of the downloads area.

3 Jul 2007, 8:01 PM
#6
designationlocutus avatar

designationlocutus

New Zenner

Join Date:
Oct 2005
Posts:
17
Plugin Contributions:
0

Re: See if I can stump you, IE 6 Transparency issue.

IE6 doesn't support PNG transparency, but there is a workaround. In your image editor (Photoshop, Fireworks etc), save the image as PNG 8 with alpha transparency set.

Check out the link below

http://homepage.ntlworld.com/bobosola/pnghowto.htm

For IE6 include the javascript in your head tag, and then set a conditional statement (included with the link) to ignore it for other browsers. Good luck :)

Rick

5 Jul 2007, 6:30 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,799
Plugin Contributions:
15

Re: See if I can stump you, IE 6 Transparency issue.

Maybe I'm lazy. If I've got access to photoshop, I'm changing the png to gif and calling test.gif from the stylesheet.

5 Jul 2007, 7:20 PM
#8
irrugly avatar

irrugly

New Zenner

Join Date:
Apr 2007
Posts:
25
Plugin Contributions:
0

Re: See if I can stump you, IE 6 Transparency issue.

dbltoe:

Maybe I'm lazy. If I've got access to photoshop, I'm changing the png to gif and calling test.gif from the stylesheet.

It might work for you, but gifs only support 1 pixel transparency, so its a no go for my design.

The above method worked perfect and saved me a lot of time, with the mod from the downloads section.

Can you setup a stylesheet for iestylesheet.css to hit all ie versions? and also an ie7stylesheet to overwrite that one? because it looks fine in ie7 just the previous looks messed up. I have a few scripts running to make most of my png's work fine in ie6 but my bg in the stylesheet doesnt get hit with the scripts. I guess ill settle for now until I finish my design then come back to it. Thanks for the help.

8 Jul 2007, 12:43 PM
#9
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: See if I can stump you, IE 6 Transparency issue.

irrugly:

Can you setup a stylesheet for iestylesheet.css to hit all ie versions? and also an ie7stylesheet to overwrite that one?You can do exactly that. The general IE stylesheet would be called first, and then overr-ideen by the one specific to IE7.

(purists will point out that it would also be possible to edit the code and have a single stylesheet included for IE LTE 7. But unless this is a very high traffic site, the difference would be insignificant.)

13 Jul 2007, 9:00 PM
#10
cfe avatar

cfe

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: See if I can stump you, IE 6 Transparency issue.

Looks like you've got it resolved, but just FYI, I posted a IE png fix here.

Using that method you don't need to worry about specific PNG types and such.

15 Jul 2007, 7:45 PM
#11
irrugly avatar

irrugly

New Zenner

Join Date:
Apr 2007
Posts:
25
Plugin Contributions:
0

Re: See if I can stump you, IE 6 Transparency issue.

cfe:

Looks like you've got it resolved, but just FYI, I posted a IE png fix here.

Using that method you don't need to worry about specific PNG types and such.

That was something I already had in my page. But just an update for you, that png fix doesnt work for any png file that is set in your stylesheet.