Help on backgrounds... sort of!

  Chris the Ancient 17:40 08 Aug 2009

Once upon a time, I created a web site using the code...


to keep a fixed background during scrolling.

It works fine in IE... but not in Firefox.

Is there a way of making it work in other explorers apart form IE?

  OTT_Buzzard 19:42 08 Aug 2009

click here

Might be of interest

  Chris the Ancient 19:49 08 Aug 2009

Interesting link with some ideas to improve the site under development.

But... no mention of a "fixed" background that I could find. :-(

  Chris the Ancient 19:52 08 Aug 2009

You were entering that as I was replying to OTT_Buzzard.

That looks interesting. Quite a different syntax. I will try it tomorrow, when I'm back in 'design mode' and see if it will work in Firefox.

  OTT_Buzzard 19:56 08 Aug 2009

The upshot is that the Body & Background syntax is no longer supported - use of CSS is the way forward.

  Chris the Ancient 20:32 08 Aug 2009

CSS is, fortunately, the way I was going forward. However, I shall continue to experiment; it's one of the ways that I learn (sometimes) and see if I can wangle a fixed background into it.

  Chris the Ancient 22:53 08 Aug 2009

I was hoping that would be the case. I'll try it inline first, and if it works I'll put it in the CSS.

Back tomorrow.

  Chris the Ancient 10:55 09 Aug 2009

More detail...

Developing these ideas using DreamWeaver 4 (I know it's old; but it's all I've got!).

For now, I have created a very simple page with enough stuff on it to need scrolling.

Using DW4, I have modified the CSS Style for body (inline style) and it reads...

<style type="text/css">
body { background-attachment: fixed; background-image: url(/backgrounds/Background.jpg) }

Unlike a solid colour, this just not show on the development page. Using the 'preview' facility for both IE and FF, the background shows and stays put. Yippee!

Save it, close it and view it (properly) in IE or FF and no background.



  Chris the Ancient 12:31 09 Aug 2009

Tried varying combinations on that line - and different images.

Also tried using a style.css - and that didn't work either.

I'm going to try reloading DW4 (after a desperately needed smoke break... naughty) in case there is a little glitch in it; though I doubt it. That'll pass a bit of time until lunch break.

  OTT_Buzzard 12:58 09 Aug 2009

Put <style type="text/css"> inside the <header> </header> tags at the top of the page.

Worth noting that you've got 'note' qualifiers around the body style as well, so get rid of the <!-- and -->

Also between the <header> tags, use:


I don't know if 'fixed' is supported, but if it is then try:

background-attachment: fixed;

Haven't tried it - hope it works for you!

  OTT_Buzzard 13:00 09 Aug 2009

forgot a bit:

At the end of the style section (and still within the <header> tags, you need to close it off with </style>

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

iMac Pro review

25 book design and illustration tips

iMac Pro review

Idées cadeaux pour geeks et tech addicts