Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Static Background Not Working 2

Status
Not open for further replies.

vjamacaddict

Technical User
Aug 12, 2005
3
US
My static background works in Internet Explorer and Webstractor. Not in Safari, Netscape, or Firefox. Is there someway to fix the code, so the static background will work with all/most browsers?

This is the webpage with the static background:



-- vjamacaddict, G4 iBook, OS X 10.3.9
 
The bgproperties is a proprietary MS attribute and is as such only supported by IE. If you want to have a cross browser solution, you need to define that via css:
Code:
<body style="background-image: url(../imagesbg/celticbg05a.jpg); background-attachment: fixed;">
 
Plus, you should use a complete doctype to keep IE from going into "quirks" mode and giving you these inconsistent results. If the page had a valid doctype, IE wouldn't have worked either.

And look at the "repeat", "repeat-x" and "repeat-y" attributes for additional functionality with your background image.

Mike Krausnick
Dublin, California
 
Mike -- Thanks for your reply! I never noticed the "repeat" before. Do I need to get rid of that? And how should I fix the code for the background image?

Someone told me to use this code instead:

<body style="background: url(../imagesbg/celticbg05a.jpg) fixed;">

After using the above code in place of the old code, the static background is working in Firefrox, Netscape, Safari, IE and Webstractor, at least on my G4 iBook. I haven't checked my webpages on my PowerMac 7300/500 yet (OS 9.1 and 8.6).

I've noticed that sometimes when I paste code into Nvu, after saving the file, the code automatically changes. Is Nvu an inferior application for creating webpages?

 
I have no knowledge what Nvu is. I am at a loss however why you simply ignored my suggestion, which was exactly the same as "someone's", just written out differently.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top