Forum Moderators: not2easy
On my page I use an alpha PNG for the background, but naturally IE doesn't support it so I would just display a barebones JPG for IE users. However, IE seems to ignore the hack altogether. Here's what I'm trying to use:
Normal CSS:
.main2 {
background-image: url(main2.png);
background-repeat: repeat-y;
width: 700px;
height: auto;
padding-left: 190px;
}
And this hack is php included as the first thing in the head -tag, before the Title and Link tags:
<!-- protect other browsers from IE6's quirks -->
<!--[if IE]>
<style type="text/css">body {
background-image: url(tausta.jpg);
}.main2 {
background-image: url(iebg1.jpg);
background-color: black;
background-repeat: repeat-y;
width: 700px;
height: auto;
}.main3 {
background-image: none;
background-repeat: repeat-y;
width: 700px;
height: 89px;
padding-left: 100px;
}ul {
margin-left: 20px;
}</style>
<![endif]-->
All other codes in that hack do work just fine, except for that background-image: url(iebg1.jpg); part. That's how it theoretically should work, but IE ignores the background completely and still tries to displays the alpha PNG with solid gray areas instead of transparency. That's why I want to make IE display a rough estimate JPG instead. Any ideas how to pull it off?
Thanks :)
[edited by: Torniojaws at 10:30 pm (utc) on Feb. 19, 2008]
It didn't affect anything.
I also tried background-image: none; and even that didn't do anything. The only explanation is that IE simply ignores the background-image setting completely. I also tried having the IE-only CSS appear after loading the real CSS file, but the end-result is the same (except that the background-image in the Body tag is also ignored, which it doesn't ignore if the IE-only CSS is loaded before the real CSS): it still uses the PNG file.
[edited by: Torniojaws at 5:12 am (utc) on Feb. 20, 2008]
[elated.com...]
Here's the parts in Head that matter:
<head><link href="layout/tyyli.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="img/favicon.ico"/>
<!-- protect other browsers from IE6's quirks -->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]--></head>
Edit:
Nevermind, IE was using a cached page and Ctrl + F5 didn't update the localhost cache. Always reload through re-entering the url -.-
[edited by: Torniojaws at 5:44 am (utc) on Feb. 22, 2008]
And this hack is php included as the first thing in the head -tag, before the Title and Link tags:
it shouldn't go first in the document it should go somewhere after the the main stylesheet is called, if it's before it's simply being overruled by the Cascade part of CSS.. perhaps put it just before </head> as it's in a template
[edited by: SuzyUK at 8:46 am (utc) on Feb. 22, 2008]