Forum Moderators: not2easy

Message Too Old, No Replies

background-attachment

scroll

         

Alternative Future

1:51 pm on Oct 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

Have a problem with the use of : background-attachment:scroll; here is a sample of the code:

external style sheet
body{
background-image: url(images/background.gif);
background-repeat: no-repeat;
background-position: 0% 0%;
background-attachment: scroll;
background-color: #336699
}
html document
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
My content
</body>
</html>

Testing it in all the latest browser versions, but the background image refuses to scroll. Can anyone see, or point me in the direction of, where I might be going wrong?

Many thanks in advance for all answers,

-gs

DrDoc

2:53 pm on Oct 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since "scroll" is default, you don't need to specify background-attachment at all.

Alternative Future

2:57 pm on Oct 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi DrDoc,

Even with removing background-attachment am still not getting what am trying to do!
Correct me if I am wrong but what I want to do is have the image scroll down the page when the scroll bar is in scroll, is this not what the scroll should do?

Thanks again,

-gs

birdbrain

3:08 pm on Oct 17, 2003 (gmt 0)



Hi there Alternative_Future,

I have just tested your code in...
IE 6 and Mozilla 1.4 and...
image and content scroll...
but I have a feeling that you really
want the image to be fixed and the
content to scroll over it, in which case
you need to use...
background-attachment: fixed;

birdbrain

Alternative Future

3:13 pm on Oct 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi birdbrain,

Gosh! Thank £$% it's Friday ;) I'll use that as the excuse anyway... hehe you are correct I do want it to be fixed, I think I was reading into it wrongly and assumed that scroll meant it went along with the scroll action... Thanks.

-gs