Forums / Templates, Stylesheets, Page Layout / Install a background to site

Install a background to site

Started by dsimon on 28 May 2012, 9:54 PM · Views: 470

Results 1 to 3 of 3
28 May 2012, 9:54 PM
#1
dsimon avatar

dsimon

New Zenner

Join Date:
Mar 2012
Posts:
82
Plugin Contributions:
0

Install a background to site

I am sure I am missing someting simple. I want to put a background image behind the basic store look.
How do I do this

THanks

Dave

29 May 2012, 12:03 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Install a background to site

You would add a background-image statement to the body rule in the stylesheet. See the #logoWrapper rule for the proper syntax. Such an image would need to be 'tileable' (able to be repeated) in order to look right at all screen resolutions.

29 May 2012, 4:28 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Install a background to site

This is all done by:

  1. creating your background image
  2. Putting it in the appropriate folder on the server (usually the images folder in your custom template system).
  3. Modifying your stylesheet.css file to call and position that image.

You need FIRSTLY to understand how the css declarations work for background images, so go to W3SCHOOLS.COM and go through their CSS TUTORIALS.

You can use very SMALL images and TILE THEM both across AND/OR down the screen. You can use larger images and position them to start at the center and the top of the screen, and tile horizontally (x-axis) only.

You can FIX the position of the image if you want to.

http://sbxlive.com has a background image that fills the whole screen, is FIXED at the center and top and tiles on the X Axis only:

body { 	background-image: url(../images/bodyback.jpg); 	background-position: center top; 	background-attachment: fixed; 	background-color: #000; 	margin: 0; 	font-family: verdana, arial, helvetica, sans-serif; 	font-size: 70%; 	color: #9e9e9e; 	}

There are "cleaner" ways of declaring the background css...

body {margin: 0;font-family: verdana, arial, helvetica, sans-serif;font-size: 75%;line-height: 150%; color: #4d4d4d;background: #fff url(../images/bodyback.jpg) center top repeat-x;}

20 years a Zencart User