|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
My Fixed Background does not work in IE
Here's the page:
http://ktd.sytes.net/files/index.html In Mozilla, on Windows and Linux, and Konqueror, the image of the donkey says fixed in the center of the screen. However, in IE, it scrolls on down. Not sure what I'm doing wrong here. I think it may have something to do with my layered divs. Any ideas? Here my style sheet: http://ktd.sytes.net/files/float3.css Thanks! |
|
#2
|
||||
|
||||
|
seems like this is implemented a bit diffrent.
take a look at quirksmode.org http://www.quirksmode.org/css/background.html just a a short quote for that page : If you want to use W3C's fixed you'll have to accept that Explorer Windows doesn't show it as intended. |
|
#3
|
||||
|
||||
|
Moz correctly positions a fixed element relative to the viewport. IE, as is common, gets it wrong and attaches to the element it's declared in. Set the background image this way;
Code:
body {
color : #a52a2a;
background : #fdfdfd url(./images/donkey.gif) fixed no-repeat center center;
width : 100%;
font : 12px "Trebuchet MS", Arial, Helvetica, Tahoma, sans-serif;
margin-bottom: 25px;
}
cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. Last edited by kk5st : June 10th, 2004 at 05:47 PM. Reason: silly smilies/stupid typing fingers |
|
#4
|
||||
|
||||
|
Hi Akh,
You've definitely changed your image ![]() IE honors background-attachment by mis-applying the specs, as you point out. It can be made to simulate correct behavior only if the background-image is attached to <body>. In that case, the body emulates the viewport for this purpose. cheers, gary |
|
#5
|
||||
|
||||
|
yeah, thought it was time for a change, had the other avatar for too long.
yet another litt msie quirk to put on the list. sometimes i don't care too much about msie's oddities, i prefer to do it the proper way and let msie do what it like ![]() (as long as it doesn't look too bad in msie, that is) |
|
#6
|
||||
|
||||
|
Quote:
Man, you guys are good... ![]() So, if I apply the background to the body tag, will it show through the other 3 div tags 'on top' of it (each with a bg color)? I'd test it now, but I don't have a windows PC at home... I'll have to do it when I get to work tommorrow... thanks for the help. |
|
#7
|
||||
|
||||
|
Quote:
I tried that in Moz (well, epiphany. Same thing, right?), and it didn't work anymore. I think its because of the other divs sitting on top of the body... |
|
#8
|
||||
|
||||
|
Any element that you want the background image to be visible through must be background-color:transparent;, the default. The body's background color will fill in.
cheers, gary |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > My Fixed Background does not work in IE |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|