Hi,
I'm trying to make a fixed background in a DIV. This is what I have
In my stylesheet I have
#rightcol {
background-color:#FFF;
float: left;
width: 530px;
height: 440px;
margin-left: 10px;
margin-bottom: 1px;
overflow: auto;
scrollbar-3dlight-color:#1B1B1F;
scrollbar-arrow-color:#1B1B1F;
scrollbar-base-color:#8C7C6C;
scrollbar-darkshadow-color:#1B1B1F;
scrollbar-face-color:#8C7C6C;
scrollbar-highlight-color:#8C7C6C;
scrollbar-shadow-color:#8C7C6C;
scrollbar-track-color:#DCCCBC;
}
In the html file I have
<div id="rightcol" style="background-image:url(pics/apple_bg.jpg);background-repeat:no-repeat;">
In Firefox this does exactly what I want. The background is in place where it should be and doesn't scroll.
In IE it's where it should be but it does scroll.
If I add background-attachment:fixed like this
<div id="rightcol" style="background-image:url(pics/apple_bg.jpg);background-attachment:fixed;background-repeat:no-repeat;">
In Firefox it doesn't scroll but it's in the wrong place. I guess it fixes itself to the body.
In IE it's in the correct place and doesn't scroll.
Can anyone tell me what's going on here? I guess I could fix this by hiding the background-attachment part from firefox, but I don't know how to do this.
I even tried to put the background-attach in an IE hack like this (I saw it in some other post here), but it doesn't seem to work. Does it only work with a class selector?
I'm trying to make a fixed background in a DIV. This is what I have
In my stylesheet I have
#rightcol {
background-color:#FFF;
float: left;
width: 530px;
height: 440px;
margin-left: 10px;
margin-bottom: 1px;
overflow: auto;
scrollbar-3dlight-color:#1B1B1F;
scrollbar-arrow-color:#1B1B1F;
scrollbar-base-color:#8C7C6C;
scrollbar-darkshadow-color:#1B1B1F;
scrollbar-face-color:#8C7C6C;
scrollbar-highlight-color:#8C7C6C;
scrollbar-shadow-color:#8C7C6C;
scrollbar-track-color:#DCCCBC;
}
In the html file I have
<div id="rightcol" style="background-image:url(pics/apple_bg.jpg);background-repeat:no-repeat;">
In Firefox this does exactly what I want. The background is in place where it should be and doesn't scroll.
In IE it's where it should be but it does scroll.
If I add background-attachment:fixed like this
<div id="rightcol" style="background-image:url(pics/apple_bg.jpg);background-attachment:fixed;background-repeat:no-repeat;">
In Firefox it doesn't scroll but it's in the wrong place. I guess it fixes itself to the body.
In IE it's in the correct place and doesn't scroll.
Can anyone tell me what's going on here? I guess I could fix this by hiding the background-attachment part from firefox, but I don't know how to do this.
I even tried to put the background-attach in an IE hack like this (I saw it in some other post here), but it doesn't seem to work. Does it only work with a class selector?