How to use css to set page background?

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
fonz
Posts: 6
Joined: Tue Feb 22, 2011 5:28 pm

How to use css to set page background?

Post 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.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: How to use css to set page background?

Post 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).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
fonz
Posts: 6
Joined: Tue Feb 22, 2011 5:28 pm

Re: How to use css to set page background?

Post 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.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: How to use css to set page background?

Post 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...
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
fonz
Posts: 6
Joined: Tue Feb 22, 2011 5:28 pm

Re: How to use css to set page background?

Post 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.
Post Reply