Post by dbhawkins » Fri Jun 03, 2011 10:30 am

All I really need is to be able to change all the whitespace background , to a picture. I want to be able to change one file and eg. bg.png and have it change the background. Get it. My background can change with the seasons and holidays. That is it. I tried this in the stylesheet.css in the template default.
body {
BACKGROUND-IMAGE: url(../brenda/image/bg.png);
BACKGROUND-COLOR: #fff;
BACKGROUND-REPEAT: no-repeat;
BACKGROUND-POSITION: center top; COLOR: #444;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
margin-top: 0px;
padding: 0px;
}
That didn't work.
Maybe i missed something. How do I do it?

Newbie

Posts

Joined
Mon May 30, 2011 11:19 am

User avatar
Active Member

Posts

Joined
Thu Nov 11, 2010 6:11 pm
Location - New Zealand (Tokomaru, Palmerston North)

Post by dbhawkins » Fri Jun 03, 2011 7:21 pm

Jeremy Fisk wrote:Delete cookies and browsing history then try it again
Nope. That didn't work.

Newbie

Posts

Joined
Mon May 30, 2011 11:19 am

Post by keithb » Fri Jun 03, 2011 8:07 pm

Hi

Try removing the duplicate COLOR declaration and change ../ to just / in the url
Also keep all padding as 0 and use full #6digit colors

i.e.

Code: Select all


body {
background-color: #ffffff;
background-image: url(/brenda/image/bg.png);
background-repeat: no-repeat;
background-position: center top;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
margin: 0px;
padding: 0px;
}

MY CAR BULBS


New member

Posts

Joined
Thu Jun 03, 2010 6:12 pm


Post by dbhawkins » Fri Jun 03, 2011 8:43 pm

Nope didn't work either. ended up with this.
body {
background-image: url(../image/bg.jpg);
background-repeat: no-repeat;
background-position: center top;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
margin: 0px;
padding: 0px;
}

Newbie

Posts

Joined
Mon May 30, 2011 11:19 am

Post by keithb » Fri Jun 03, 2011 10:11 pm

Preview: Re: image background in 1.5
Strange that...
It works fine on my localhost setup - (whereas your code does not).

I am presuming your store is located in a brand subfolder and the stylesheet.css has not been moved?

Anyway at least its working now!

MY CAR BULBS


New member

Posts

Joined
Thu Jun 03, 2010 6:12 pm


Post by dbhawkins » Sat Jun 04, 2011 3:38 am

No I never got it to work. It is on a host that meets opencart requirements, and in a subfolder, just for testing. Think I will just stay with the version I am using for a while until they write another book or add a opencart for dummies forum for me. I am much better at routing wood signs . I thought it would have been a simple task, I even spent 6 hours on the w3school site, reviewing basic css, anyway. Thanks for the reply.

Newbie

Posts

Joined
Mon May 30, 2011 11:19 am

Post by dbhawkins » Sat Jun 04, 2011 4:57 am

Sorry. I got it to do what I wanted.
Changed it in the stylesheet.

body {
background-image: url(../image/bg.png); margin: 0px; padding: 0px; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif;
}

Now I can work with it straight out of the box and upgrade with the revisions without all the worries and stress. Coolio!
Maybe they will incorporate a css background image and color changer one day for folks like me.

Oh yeah I did, and I do donate. "Go OpenCart!!" You guys Rock!

Newbie

Posts

Joined
Mon May 30, 2011 11:19 am

Post by WebDevTim » Fri Apr 20, 2012 1:37 pm

I am having the same problem on a localhost. This is what the body style looks like:

body {
background-image: url(../image/bg.png); margin: 0px; padding: 0px; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif;
}

I can manipulate the background color but the background image won't display. Since I renamed the default admin and theme folders I had to go through all the files in hte model view controller and change the names from default or admin to the names I chose. I made sure that I didn't miss a single instance. I actually killed the roll back feature, but I can put that back by changing every instance in the IF ELSE statements where I changed the name from "default" to my unique name back to default. I am not worried about that. My theme is in the uniquely named folder and from the stylesheet.css in that folder everything else responds to changes I make there except the background-image I can change the #container dimensions and I see the change immediately in the browser. But no matter what I do for the image it will not display. Tried .png, .jpg and .gif just to make sure that I wasn't missing something. Anyone have any ideas. Oh yes I have OpenCart 1.5.2.1 installed on Apache 2.2.21 My SQL 5.5 PHP 5.3.8 MyPHPAdmin 3.4.6

Newbie

Posts

Joined
Fri Apr 13, 2012 4:57 am

Post by Avvici » Fri Apr 20, 2012 1:46 pm

This should work fine so as long as your image is actually accessible and your URL is pointing to the image correctly.
Also keep in mind that everything the background image does not cover will be white. if you want to choose a different color then just change the #FFF

Code: Select all

body {
	
	background:#FFF url(../brenda/image/yourimage.jpg) top center;
	background-repeat:no-repeat;
	color: #000000;
	font-family: Arial, Helvetica, sans-serif;
	margin: 0px;
	padding: 0px;
}

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC
Who is online

Users browsing this forum: No registered users and 21 guests