Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Trouble with css images

Trouble with css images

Views: 1,832

Results 1 to 17 of 17
8 Jul 2011, 12:58 PM
#1
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Trouble with css images

Hi - I am a total novice in this but need to get this website going and move on...

I've changed product images via cpanel and uploadedmenu, header images via cpanel inot the images folder, i've changed many elements in css. But for some reason I can't seem to properly route that header image in CSS stylesheet. I can;t replace the original Zencart header and can't replace the body background colour with a background image, which isanother thing I need to do.
(I've checked the cpanel is pointing at the right custom template)
I am working in a customised version of Zencart contemporary Green.

http://www.sugar-mouse.co.uk/

Here's the header code...

#headerWrapper{
background-image: url(file:///C|/Users/Cliffecm/AppData/Local/images/boardzen.jpg);
background-repeat: repeat-x;
background-color: #ffffcc;
height:180px;
}

Thanks in anticipation - I just can;t figure out what I'm doing wrong.!!!

8 Jul 2011, 2:10 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble with css images

url(file:///C|/Users/Cliffecm/AppData/Local/images/boardzen.jpg)
```This is the path to a file on your home pc, not the web server location.

url(../images/boardzen.jpg)



Your stylesheet has an error right at the top:```
body {

	background-color:#FFFFCC;

	#logoWrapper{

	background-image: url(file:///C|/Users/Cliffecm/AppData/Local/images/menuboard1.jpg);



	}



	;

	background-repeat:repeat;

	background-attachment:fixed;

	margin: 0;

	font-family: verdana, arial, helvetica, sans-serif;

	font-size: 62.5%;

	color: #00000;

	background-color: #FFCCCC;	}
```The #logoWrapper should not be inside the body {} rule.
9 Jul 2011, 8:38 AM
#3
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

Hi there - thanks very much for your time and trouble.

I've changed the bad script at the top but am trying to change the header script to point to the images folder on the server.

I know this is fundamental, but how exactly do you do that? I've hit browse and of course wrongly chosen the image file stored on my computer, but I need to point that browse to the server and fetch the file I need from images.

http://www.sugar-mouse.co.uk/ is the site for interest....

thanks again,

Cliff.

9 Jul 2011, 1:50 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble with css images

Since this a template image, not a product image, you should save it in /includes/templates/your_template/images/.
Then background-image: url(../images/boardzen.jpg); will find and use the correct image.

11 Jul 2011, 1:02 PM
#5
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

Dear gjh42 - I'm really indebted for your taking this trouble with me...

thanks for your reply... You know that's exactly where the image is and I've tried this path which you first suggested and it still isn't picking it up..

when i then go back into the stylesheet the line is pointing again to the image on my computer.

totally bamboozled now.

11 Jul 2011, 3:41 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Trouble with css images

I think part of your issue is that you are probaby trying to create a "page" in an external editor - possibly DreamWeaver, and then trying to apply that "page" to zencart.

Interestingly... Zencart (like all CMS platforms) has NO PAGES...

... well... not in the sense that you may understand the idea of "web pages".

Zencart "assembles" the pages "on-the-fly". They do not exist until they are "requested" by the person viewing the site. Depending on what the viewer selects, the assembly code (the PHP) goes about gathering up all the component bits for the requested page, and these "bits" come from many places - including data from the database, images from the images folders, and perhaps some pre-formatted HTML chunks from places like the define_pages folders.

But essentially, there are no "pre-existing" pages. When a person clicks a link or a button, the page they are on "evaporates" forever, and a new page is assembled. Along the way, a CALCULATION may be performed, and some additional information may be written into the database for use later on (such as items in the shopping cart).

Some pages comprise HUNDREDS of assembled elements - all cobbled together by the PHP code...

You need to abandon "conventional" HTML protocols here... A CMS does not consist of "flat" html pages.

11 Jul 2011, 4:10 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Trouble with css images

Did you actually change the stylesheet rule to use background-image: url(../images/boardzen.jpg); ?
Did the changed file correctly upload to the server?

11 Jul 2011, 6:20 PM
#8
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

Thanks once again for your swift replies... I haven't actually got anywhere with loading my front page yet...that's a whole other problem!

In answer to gjh, I have copied and pasted from your replies
url(../images/boardzen.jpg). i upload it revised stylesheet to
/public_html/sugar-mouse.co.uk/includes/templates/CUSTOM/css
directly into my stylesheet and it overwrites thelast version. When i check the stylesheet afrer the process, it hasn't updated at all... should i rename the file altogether? I know in some programs like photoshop, when svess don;t seem to work, problems can be overcome by renaming the file. :frusty::frusty:
many thanks...

11 Jul 2011, 10:38 PM
#9
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Trouble with css images

It sounds like you're having, perhaps, permissions problems on your server. Can you delete the stylesheet in that folder? Does it stay deleted? If not, contact your server folks and find out how to set things up so you have the necessary permissions.

Rob

12 Jul 2011, 9:15 AM
#10
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

Dear Rob,

Thanks for the tip.

That's what I'm going to do now Hopefully it will solve it. Watch this space...

Cliff.

12 Jul 2011, 11:29 AM
#11
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

RESOLVED!!!

on Rob's advice, I spoke to my hosting company...

it wasn't the permissions, the problem turned out to be the installation of firefox on my computer.
hosting co. told me i shd switch to another browser.
before i switched to Opera, he asked me to clear the firefox cache, disable all ext t ensions and add ons (in Firefox help) then as it still didn;t work, he explained thathe proiblem was definitely not one connected to permissions but was about the instrallation of firefox.. he advised i switch browser and suggested Opera. I did and it came up fine.:clap:

thanks for all help.
gjh, schoolboy, rob...

i hope my strife and your input can be of help to others...

  • phew!

Cliff.

12 Jul 2011, 12:17 PM
#12
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

re - above message - i spoke too soon. the same problem is now in Opera.

12 Jul 2011, 1:03 PM
#13
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

Hi - I now have a problem that I can make some changes in opera... but they are only visible in the firefox browser - not in the opera browser. and not all the changes that i make working in the cpanel in opera are taking effect in firefox...
it's now a bit of a mess.
http://www.sugar-mouse.co.uk/

i'm trying to change the image and lower it a little but that ain't taking.
even before i do anything with that menu bar!
cliff.

12 Jul 2011, 7:14 PM
#14
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Trouble with css images

Ah, cpanel. I didn't catch that you were doing things that way.

I can't offer my own opinion since I've never edited files through cpanel, using my browser. But I can recall others here on the forum saying that using cpanel to edit files can be the source of problems. (I don't recall why, but the advice was not to do it.) How do I do it? I thought you'd never ask! :smartalec:

I keep a full copy of both Zen Cart untouched and my current cart with all its mods here on my local hard drive. I do any necessary editing in my local copy and upload the changed file to the server using ftp. Sometimes, if I need to iterate through some possibilities, I'll make the edits on the server copy, using my ftp program to open the file in my local editor of choice (BBEdit). Then once I've got things the way I want it on that server version of the file, I make sure to bring a copy down to my pc for safe keeping.

Working this way ensures that you can update files -- if you uploaded the file via ftp, you're the owner of it and can edit it -- and that I have a full current backup of the site.

Rob

13 Jul 2011, 11:01 AM
#15
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

Blimey - you resolve one problem and another comes in its stead.
Am i able at this late stage t otranfer my firles to my hard drive. The css files, php ones that i;ve tinkered wit hdo live in my site folder on my hard drive the but i havben;t got the whole thing.
what should i be downloading and how do i do it?
backup sounds v good to me.

also, how do i upload via ftp?

thanks again for your advice.

13 Jul 2011, 11:20 AM
#16
cliffecm avatar

cliffecm

New Zenner

Join Date:
Jul 2011
Location:
Darlington, UK
Posts:
23
Plugin Contributions:
0

Re: Trouble with css images

ok - sorted ftp upload via filezillla, of course!

13 Jul 2011, 11:08 PM
#17
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Trouble with css images

You can also use filezilla to bring down to your local drive a copy of the entire site. I don't bother copying the various images folders, because I have all the images here anyway.

Rob