1
bumbum
Static Background image???
  • 2007/3/20 22:13

  • bumbum

  • Just popping in

  • Posts: 99

  • Since: 2004/10/18


I'm trying to place a background image on my site that is static - eg. always in the background and in the middle of the page no matter where you scroll on the page. I've searched it out and found various style sheet sugestions on the internet that don't work.
Also, there is a mention of in in the XOOPS FAQ (https://xoops.org/modules/smartfaq/faq.php?faqid=408) but this refers to html tags in the body rather than a solution in style sheets.
The html option will lead to tiling of the image and I don't want that. Can anyone point me in the right direction here please?

2
JMorris
Re: Static Background image???
  • 2007/3/20 22:47

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


body {
    
background-image:url(images/background.jpg);
    
background-position:center;
    
background-repeat:no-repeat;
    }


That should do what you're wanting. The image directory referenced in the CSS is the image directory in whatever theme you are using.

HTH.

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

3
bumbum
Re: Static Background image???
  • 2007/3/21 21:48

  • bumbum

  • Just popping in

  • Posts: 99

  • Since: 2004/10/18


hmm, Thanks for responding. I've tried that out alright but the background image is STILL scrolling with the page despite the Quote:
background-repeat: no-repeat;
line.
I've viewed in on both Firefox & IE with the same results.

I've cloned the 'default' template for this. Do you know if there's anything strange in there that might be causing this behaviour?

4
JMorris
Re: Static Background image???
  • 2007/3/21 21:57

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Whoooops! Forgot one...

Add
background-attachment:fixed;


...and that should fix your problem.

HTH.

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

5
bumbum
Re: Static Background image???
  • 2007/3/25 18:47

  • bumbum

  • Just popping in

  • Posts: 99

  • Since: 2004/10/18


Oh you dancer James. That got it for me. :)

Login

Who's Online

177 user(s) are online (89 user(s) are browsing Support Forums)


Members: 0


Guests: 177


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits