Page 1 of 1

How to use css to set page background?

Posted: Tue Feb 22, 2011 6:03 pm
by fonz
Script URL: localhost
Version of script: 2.2
Hosting company: local testing server
URL of phpinfo.php: v5.2.14 - php modules can not be the problem, the script works perfectly.
URL of session_test.php:
What terms did you try when SEARCHING for a solution: css background, background image, css

Write your message below:
Hi, I just downloaded on Friday, 18 feb/11, and your script works perfectly. Sorry I could not provide all the information you asked above, as I always test and modify on a local machine, prior to going live.

Everything has set-up perfectly; however, I am having one problem. It is so simple that I hesitated posting, but I am stumped.

Using hesk_style.css, I modified the text and background colours easily. The problem is that when I attempt to set a background image, nothing. The image is located in the img folder, and displays when I type the direct URL, so I know it is there and can display.

So far, I have used a relative URL in the css background-image: url(../bkgrnd.png): and full URL background-image: url(http://localhost/helpdesk/img/bkgrdn.png): . The full URL is the one I type into the browser that displays the image.

I am probably going to be very embarrassed at not doing something right. Any help is greatly appreciated.

Re: How to use css to set page background?

Posted: Tue Feb 22, 2011 6:42 pm
by Klemen
The CSS line should end with

Code: Select all

);
(semi-colon) and not with

Code: Select all

):
, so try

Code: Select all

background-image: url(http://localhost/helpdesk/img/bkgrdn.png);
You will also probably need to force refresh pages on localhost to apply changes to CSS (press F5 in browser or click the refresh browser icon).

Re: How to use css to set page background?

Posted: Tue Feb 22, 2011 11:42 pm
by fonz
Hi Klemen,

Yes, of course it should end with a semi-colon, not a colon. In the css, it is exactly as you posted. I just made a type when posting here. Sorry. :oops:

I have the code exactly as you posted, and always refresh the browser...even close it cause a simple refresh does not always work. Unfortunately, that is not the answer. :cry:

I apologize for not being more careful with my post in the forum.

Re: How to use css to set page background?

Posted: Wed Feb 23, 2011 4:00 pm
by Klemen
Perhaps you're applying the background image to the wrong CSS class? Nobody but you saw your CSS files, so we can't be sure what is wrong...

Re: How to use css to set page background?

Posted: Wed Feb 23, 2011 4:47 pm
by fonz
I apologize for that, Klemen. You are correct, I should have noted the css class to which I was applying the modifications. This is the exact code I am using:

Code: Select all

BODY {
	background-color: #475a6a;
	background-image: url(http://localhost/helpdesk/img/3bg2.png) !important;
	color: #475a6a;
	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	margin-left:0;
	margin-right:0;
	margin-top:0;
	margin-bottom:0;
}
Apparently, I needed to ad the !important tag. That made it work.

I do appreciate all your assistance. Once I have this finished and up on the client's site, I will suggest he purchase a license.