Forum Moderators: open

Message Too Old, No Replies

background image - no repeat?

         

SimbaGirl

5:34 pm on Mar 6, 2005 (gmt 0)

10+ Year Member



Howdy!

The page I'm building's content has exceeded the size of its background image. (btw, my screen resolution is set to 1024x768)

I know there is a code of some sort one can write that makes the content scroll up/down while the bg image stays in place.

I'm not sure if it's CSS or HTML... Or, for that matter, just what it is...

Anyone know what I mean?

Thanks. :)

jo1ene

5:40 pm on Mar 6, 2005 (gmt 0)

10+ Year Member



<style>
body {
background-repeat: no-repeat; //no tiling, or
background-repeat: repeat-x; //tiles horizonatlly, or
background-repeat: repeat-y; //tiles vertically
}
</style>

tedster

5:46 pm on Mar 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



makes the content scroll up/down while the bg image stays in place

Welcome to the forums, SimbaGirl.

I think you're looking for background-attachement:fixed

Inline
<body style="background:url(your image url here);background-attachment:fixed;">

External
body {
background:url(your image url here);
background-attachment:fixed;
}

SimbaGirl

6:14 pm on Mar 6, 2005 (gmt 0)

10+ Year Member



(Thanks! :) Looks like a great site.)

Well, I put in the code and it brought me to a familiar problem; it wiped out my page. (Same thing happens when I try to insert an IMG code for an image) This has happened before. And I haven't been able to make CSS work for my background image because of that. Instead, I've been using this HTML code:

</STYLE>
<body background="TheLog.jpg">
</style>

I should be able to use that CSS. I know I must be doing something terribly wrong...I'm confused.

tedster

6:37 pm on Mar 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can't be sure you've really fixed the way a site looks unless you know that your HTML is valid. Since the W3C sets the standards, using their free online validators is the best way to go.

W3C Validator - HTML [validator.w3.org]
W3C Validator - CSS [jigsaw.w3.org]

Also, background-attachment:fixed is not supported on older browers - which browser and operating system are you using?