PDA

View Full Version : Background Image on a Website


DBH
05-31-2002, 08:20 AM
How can I make a background static with everything else on a web site moving? By static, I mean the background image doesn't move but the contents of the site moves with the scroll bar.

Thanks for any help! http://www.PCGuide.com/ubb/smile.gif

Steve
05-31-2002, 09:21 AM
If you want the background image to remain stationary when a user scrolls through the web page, use the "fixed" value. (no quotation marks)

http://www.PCGuide.com/ubb/smile.gif

------------------
Peace and Love, brothers and sisters. Peace and Love

DBH
05-31-2002, 09:47 AM
Thanks for the reply, Steve, but it didn't seem to work. This is the background line: BODY BACKGROUND="IMG/starback2.gif"...I took the quotations off and nothing happened. I refreshed the page, saved the new code...nothing. Did I do something wrong?

Steve
05-31-2002, 10:00 AM
Hi,

I haven't used it before so I'm not really sure how it works. http://www.PCGuide.com/ubb/rolleyes.gif
I looked it up in my HTML textbook for you.

Here's the example they use {background: url("background.jpg") fixed}

If that doesn't work, hang on a while. I'm sure one of the folks here knows what you're looking for. http://www.PCGuide.com/ubb/wink.gif



------------------
Peace and Love, brothers and sisters. Peace and Love

DBH
05-31-2002, 11:40 AM
Thanks again for the help, but it isn't working. http://www.PCGuide.com/ubb/frown.gif Does anyone know of any websites where the background is stationary? Maybe I could check out the source.

Dave

david eaton
05-31-2002, 03:24 PM
Hi DBH The Background attachment property only works in IE. Pity really as it's a good effect. The way I did it was

<body background img src="images/elev.gif" bgproperties="fixed">

According to my understanding of the tag, the bgproperties tag is ignored by anything other than IE3+.
Hope that helps.

David

------------------
If man could be crossed with the cat, it would improve the man, but disimprove the cat.

Mark Twain

DBH
05-31-2002, 03:53 PM
it worked!! Thanks a bunch, David!

Now, I tried this with one of my Cascading Style Sheets, but it didn't work. Is it possible to have a stationary background in a CSS?

Thanks!



[This message has been edited by DBH (edited 05-31-2002).]

DBH
05-31-2002, 04:20 PM
I found it! Here is the script for CSS

{
background-image: url("../images/smiley.gif"); background-attachment: fixed
}