Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Im creating a site using layers. i have a layer set to 100%wide and 100%high with an image inside which fills the screen and is basically a background. I have other layers over this with content in them. As the content increases and you need to scroll down, the layer with the image scrolls too, but I want it to be fixed, like you can fix an actual background. Is this possible to fix a layer? Can it be done in CSS at all?
Cheers.

Hi Nick,
I do this very thing for the background on my site. I'm not using frames, but it'll still work for you.
In Dreamweaver, in the design view, right-click inside the layer you want your background to appear in. From the list, select "CSS Styles" > "New CSS Style". In the dialog box, select "body" from the drop-down list... check "redefine html tag", check "define in" and select (New Style Sheet File). You'll then name your css file and select a location for it. You should save it in the same folder as your hmtl document.
Once you save it, you'll get a "CSS Style Definition" box. You can play around in here, but for what you want... select "background" on the left. Then configure the right side with what you want. under "attachment" you should choose "fixed". Play with different settings and see what it does in your browser. Also look in different resolutions because your image will tile horizontally as well as vertically.
Once you have your CSS file the way you want it, open your other pages and link to it by right-clicking in the frame and this time select "CSS Styles" > "Attach Style Sheet". You can choose "link" or "import" and browse to the file.
You can also select "CSS Styles" > "Edit Style Sheet" to go back and change it.
And that's it.
Post back if you have troubles.
SullyD
Experience is what you get when you don't get what you want...

Hi
Thank you very much, but I dont think its worked, which means I dont think what I want to do is possible. I have a big picture to use for my background, its size is 180 x 1024 so this way it will scale down.I have put this in a layer as an actual IMAGE. This will be my "Background" I have set the image size to 100% x 100% so it will scale with the screen, the layer it is placed in is also set to 100% x 100%.
The thing is I want that scalable image to act as my background and stay fixed and fit-to-screen, so for example when the user scrolls down to due to more information or even a smaller resolution, the image will stay where it is and not scroll up.
Im sorry if this sounds confusing, but what Im trying to do is fudge something together so I have a background that fills the browser and will not scroll away and will resize to match the resolution so you can always see the complete picture.

![]() |
HELP! Page looks strange ...
|
how to save website user'...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |