Forums / Templates, Stylesheets, Page Layout / Background image...and yes I've looked EVERYWHERE

Background image...and yes I've looked EVERYWHERE

Views: 1,023

Results 1 to 5 of 5
27 Feb 2011, 7:50 PM
#1
curbsidestudiosnet avatar

curbsidestudiosnet

New Zenner

Join Date:
Jun 2010
Posts:
32
Plugin Contributions:
0

Background image...and yes I've looked EVERYWHERE

blah blah blah...I keep reading about just adding

/*wrappers - page or section containers*/
	#mainWrapper {
	background-color: #FFFFFF;
	background-image:url(../images/smartbg_wm.gif);
	background-repeat:no-repeat;
	background-position:center;
	text-align: left;
	width: 100%;
	vertical-align: top;
        }

but its not putting my watermark BG image. I've messed with the Smart BG module and totally abondoned that. Didn't get the hang of it.
My url is http://www.force-test.com.

Anyone know what I'm doing wrong? I just want the bg to show, even if its ONLY on the main page.

27 Feb 2011, 8:14 PM
#2
celtic avatar

celtic

Zen Follower

Join Date:
Feb 2010
Posts:
154
Plugin Contributions:
0

Re: Background image...and yes I've looked EVERYWHERE

curbside,

You have the background set to 'white' in both the #mainWrapper and the .content_bg styles.

Taken them out and your background image will show behind the text.

PS.

Use the 'inspect element' option (right click a webpage) in Google Chrome browser to save yourself hours of headache when looking for these sorts of problems.

27 Feb 2011, 8:32 PM
#3
pops42 avatar

pops42

New Zenner

Join Date:
Feb 2009
Posts:
11
Plugin Contributions:
0

Re: Background image...and yes I've looked EVERYWHERE

curbsidestudiosNET:

blah blah blah...

I could not see any image located at http://www.force-test.com/images/smartbg_wm.gif
also, the line defining the gif is missing the apostrophes at either end of the url.
also, to see on every page the gif should be defined in the body section

body {
	margin: 0;
	background-color: transparent;
	background-image: url([B]'[/B]http://www.force-test.com/images/smartbg_wm.gif[B]'[/B]);
    background-attachment: fixed;
	}

the 'fixed' element is to stop the picture scrolling if longer than the displayed page

BING A BONG A BOO !

28 Feb 2011, 2:59 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Background image...and yes I've looked EVERYWHERE

The apostrophes are not needed in the url(../images/etc) value. It works the same with or without them. There is no reason to use the full URL - in this case just url(images/smartbg_wm) should work. Template images like this should really be in /includes/templates/your_template/images/, not /images/ as you show.

#mainWrapper is the right location for a bg that will show on every page, inside the page boundaries. The body rule applies to the entire screen, even outside of the "page" border if any.

the 'fixed' element is to stop the picture scrolling if longer than the displayed pageTo clarify, "fixed" keeps the bg fixed in the window even if the page is longer than the window. The page content would scroll up while the bg stays in place, which may or may not be what you want. That is a design decision.

28 Feb 2011, 3:16 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Background image...and yes I've looked EVERYWHERE

If you were using smartbg_wm as a filename to activate the Smart Backgrounds code, that would explain the failure, as would using the base /images/ folder instead of the template /images/ folder. SBG is not the right tool for putting the same background on every page anyway. If you wanted only the homepage, you would use
#indexHomeBody #mainWrapper {background: etc;}