Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Editing CSS in Dreamweaver, trying to put a background image.

Editing CSS in Dreamweaver, trying to put a background image.

Locked

Views: 4,297

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
11 May 2008, 4:34 PM
#1
jamesdavid avatar

jamesdavid

Zen Follower

Join Date:
Apr 2008
Posts:
193
Plugin Contributions:
0

Editing CSS in Dreamweaver, trying to put a background image.

I’m using a template override and im editing the CSS. I’m using Dreamweaver to edit it so I can see all the CSS styles and there names in the CSS Styles window.

What styles controls the background image on the page?

11 May 2008, 4:43 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Editing CSS in Dreamweaver, trying to put a background image.

There are a couple of possibilities depending on exactly how your page display is set up. It could be the body {} declaration you need to add your background to, or #mainWrapper {}, or possibly others.

The property you want to use is

background-image: url(../images/yourbg.gif);

and possibly also specifying background-repeat: and background-position:.

I don't know how Dreamweaver works, but if it doesn't show you the class/id of the element, you might try the Firefox Web Developer extension to get information (it also allows you to temporarily edit CSS and see the results instantly.)

11 May 2008, 7:17 PM
#3
jamesdavid avatar

jamesdavid

Zen Follower

Join Date:
Apr 2008
Posts:
193
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

I’ve been trying to figure this out for a while now and ive made the following changes to the css, but nothing seems to work;

#navMainWrapper, #navSuppWrapper, #navCatTabsWrapper {
margin: 0em;
background-color: #abbbd3;
background-image: url(../images/tile_back.gif);
padding: 0.5em 0.2em;
font-weight: bold;
color: #ffffff;
height: 1%;
background-repeat: repeat;
}

.centerBoxWrapper {
border: 1px solid #9a9a9a;
height: 1%;
margin: 1.1em 0;
/* create free space at the bottom of the box in which to display the image /
padding-bottom: 20px;
/
add the image to the boxes background /
background-image: url(file:///Macintosh%20HD/Applications/MAMP/htdocs/gemstones/includes/templates/newtemplate/images/backgroundfade.jpg);
/
position the image at the bottom and center of the box /
background-position: center bottom;
/
EITHER set the image to not repeat /
background-repeat: no-repeat;
/
OR set it to repeat horizonatally */
background-repeat: repeat;
}

.leftBoxHeading, .centerBoxHeading, .rightBoxHeading {
margin: 0em;
background-color: #abbbd3;
background-image: url(file:///Macintosh%20HD/Applications/MAMP/htdocs/gemstones/includes/templates/newtemplate/images/backgroundfade.jpg);
padding: 0.5em 0.2em;
}

11 May 2008, 7:30 PM
#4
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,845
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

the url to the image should be relative to the stylesheet...so you want it to look like:

/* add the image to the boxes background */
background-image: url(../images/backgroundfade.jpg);

which reads like "to get to the image go up one directory, over to the images directory and there you will find the image"

11 May 2008, 7:31 PM
#5
pots avatar

pots

New Zenner

Join Date:
Apr 2006
Location:
France
Posts:
53
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

sorry doubled reply took me too long

12 May 2008, 10:32 AM
#6
jamesdavid avatar

jamesdavid

Zen Follower

Join Date:
Apr 2008
Posts:
193
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

By putting the folowing code into
#navMainWrapper, #navSuppWrapper, #navCatTabsWrapper {

I can make a background image for the navigation bar and footer, but I still cant find where to put it for the main background pages.

code:
background-image: (../images/backgroundfade.jpg);
background-repeat: repeat;
background-position: center bottom;

putting the code into .centerBoxWrapper does nothing.

12 May 2008, 3:15 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Editing CSS in Dreamweaver, trying to put a background image.

The Firefox Web Developer Information > Display Element Information button is the resource that tells you what class/id to edit in the stylesheet for a given element. Since people can make many custom tags for particular situations, a static document would not necessarily be accurate for everyone.

I do agree about the annotated stylesheet - it really needs to have notes on what the selectors represent more than what the properties do.

12 May 2008, 3:29 PM
#9
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Editing CSS in Dreamweaver, trying to put a background image.

gjh42:

I do agree about the annotated stylesheet - it really needs to have notes on what the selectors represent more than what the properties do.

Yes, I think that would help a lot of people, including myself.

12 May 2008, 3:31 PM
#10
jamesdavid avatar

jamesdavid

Zen Follower

Join Date:
Apr 2008
Posts:
193
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

How do I put a background image in my main page?

12 May 2008, 3:59 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Editing CSS in Dreamweaver, trying to put a background image.

Post a link to your site, and/or describe exactly where you want the background. As noted above, there is more than one possibility for this. The Firefox Web Developer can let you find this for yourself.

12 May 2008, 4:20 PM
#12
jamesdavid avatar

jamesdavid

Zen Follower

Join Date:
Apr 2008
Posts:
193
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

I managed to figure if out with the firefox tool, thanks a lot for the tip.:smartalec:
james

12 May 2008, 8:55 PM
#13
maidanet avatar

maidanet

New Zenner

Join Date:
May 2008
Location:
Colorado Springs, CO 80904
Posts:
1
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

And you're not going to share what you found out with the rest of us? :wink:

12 May 2008, 9:04 PM
#14
jamesdavid avatar

jamesdavid

Zen Follower

Join Date:
Apr 2008
Posts:
193
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

Cant believe im helping someone! Using template override, change stylesheet.css

#headerWrapper, #contentMainWrapper, #logoWrapper, #cartBoxListWrapper, #ezPageBoxList, #cartBoxListWrapper ul, #ezPageBoxList ul, #mainWrapper, #popupAdditionalImage, #popupImage {
margin: 0em;
padding: 0em;
background-image: url(../images/main.jpg);
background-repeat: repeat;
background-position: top;
}

Worked for me but im a bit of a newbie. Good luck.

Firefox Web Developer and Firebug are both great for finding the bit of the CSS you need to change.

13 May 2008, 6:55 AM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Editing CSS in Dreamweaver, trying to put a background image.

As you will notice, this will put the same image into each of the locations in the list. If you only want the image once, or tiled in one continuous sweep instead of several chunks, isolate the element where you want the bg, like this:```
#headerWrapper, #contentMainWrapper, #logoWrapper, #cartBoxListWrapper, #ezPageBoxList, #cartBoxListWrapper ul, #ezPageBoxList ul, #popupAdditionalImage, #popupImage {
margin: 0em;
padding: 0em;
}

#mainWrapper {
margin: 0em;
padding: 0em;
background-image: url(../images/main.jpg);
background-position: top;
}

"Repeat" is the default, so you only need to specify background-repeat: if you want something other than continuous tiling, like repeat-x, repeat-y, or no-repeat.
11 Jun 2008, 6:55 AM
#16
emberrains avatar

emberrains

New Zenner

Join Date:
Jun 2007
Posts:
13
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

What if my background has three images? three separate images to make one, how would I do that? :huh:

11 Jun 2008, 7:22 AM
#17
gjh42 avatar

gjh42

Black Belt

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

Re: Editing CSS in Dreamweaver, trying to put a background image.

If the three images align with parts of your page, you can use them as backgrounds in those parts.
A link to your site and description of exactly where you want the images to appear will let us give useful advice.

11 Jun 2008, 6:15 PM
#18
emberrains avatar

emberrains

New Zenner

Join Date:
Jun 2007
Posts:
13
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

http://dawnenchantments.com/demo/

I'm just starting, I want to make sure the background it going to work with what I want.

I have a background that has a top, middle and bottom, I can put the top in but what code would I use for the middle and bottom?

Thanks so much

11 Jun 2008, 6:35 PM
#19
jamesdavid avatar

jamesdavid

Zen Follower

Join Date:
Apr 2008
Posts:
193
Plugin Contributions:
0

Re: Editing CSS in Dreamweaver, trying to put a background image.

Get firefox and then install firebug.

Use Firebug to see what divs you want to attach background images to. (You may want to attach just one image to the mainWrapper div).

Set the background image to the divs you want with your css.

11 Jun 2008, 6:38 PM
#20
gjh42 avatar

gjh42

Black Belt

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

Re: Editing CSS in Dreamweaver, trying to put a background image.

You could put the top in #headerWrapper, and the middle in #mainWrapper or #contentMainWrapper, or the body {} declaration. The bottom could go in #navSuppWrapper or #siteInfoLegal, depending on its height. You could also put the bottom in #mainWrapper if the middle is in body or #contentMainWrapper.

The best answer will depend on exactly how high each part of the background image is.