Keeping a background stationary as content scrolls?

katetownley22

New Member
Hey - I'm trying to figure out how to keep the background on a page stationary - so the content scrolls and the background doesn't. There's an example here: http://ismaelburciaga.com/

I'm fairly adept w/ html and css. That's about it, but I can learn what I need to!
Any help is much appreciated :)

Thanks!
Kate
 

denno020

New Member
Here's some CSS pulled straight from dreamweaver. You will need to use CSS to make it work in browsers other than IE. If you only want it to work in IE then go to the HTML code below it.

<head>
<style type="text/css">
<!--
body {
background-image: url(../Documents/Porties%20Website/Website/Porties%20Blue.png);
background-repeat: no-repeat;
background-attachment: fixed;
}
-->
</style>
</head>

HTML way for IE:
<body background="image.gif" bgproperties="fixed">

I suggest you use the CSS way :). Not too hard, and will ensure that us firefox and chrome etc. users can still get the full experience of your site.

Denno
 

Kazoo

New Member
I take it your using CSS? This is no problem in dreamweaver CS4.

Locate your CSS rules in your CSS folder that you should have created in your CSS panel.

Open your folder and you should have an option for "Body" double click on that and a dialogue box will appear with a column for:

  • Category
  • Background
First from the category column select "Background" (click on it)

A list of options should be available to you, one of these options is:

"Background attachment"

I am guessing that you currently have this set to "scroll" from the pull down menu, you can change this to "fixed".
This will rectify your problem and keep the background "fixed" while you scroll.

Hope this helps
 
Top