View Full Version : backround image script?

08-15-2005, 03:22 AM
Hello all I'm a newbie at much of this stuff. If this is in the wrong section, or breaking the rules just let me know!

My question is this: I had been using 10mb of space provided by my ISP, for a website. Recently an online game clan I'm in (yes at 42 yrs of age), started renting a larger server. They have offered 500MB on a Linux Debain, with cPanel server.

When I write the html and load it, alls well. However, I can't seem to get the script write, to load a backround image?

I tried this: <body background="images/dbh_page.jpg"> ; as that is the name of the JPG I'm using.

Any suggestions? I have altered it a few different ways, without success? I've been trying to get this right, for 6 hours now, and am at me witts end.

Thanks for your help in advance, Rick

08-15-2005, 12:40 PM
That's not how you load a background image. :)

You should use CSS, place in <head>.

<style type="text/css">
body { background-image: url(images/dbh_page.jpg) }


Tristan Gray
08-15-2005, 02:13 PM
And that is not considered a script, heh, unless you want a random background image to be displayed.

08-15-2005, 02:23 PM
Thanks for the help I appreciate it. Rick

08-15-2005, 04:36 PM

There , learn to read some that suits your need. :)

08-15-2005, 07:35 PM
And if the code Mark posted didn't work, the problem could lie in that it is being case-sensitive in the filenames. Like MyImage.jpg isn't the same as myImage.jpg

08-22-2005, 04:59 AM
Mark thanks for the info it's appreciated! I haven't learned anything about css? Someone lese mentioned a page, they thought I should look at r/t css.

Trisitian - I just got into this two weeks ago, script, not script? I don't know it all. Actually probably very little, but this is all I have so far.


Iota - Thanks for the link I will check it out!

Oracleguy - I made sure everything is matching in small case. What I have read, said for html everything should be in small caps???

I'm basically doing this for a group of people I play a game with, online. We wanted to go php. As I read about it, it seemed if one can get a handle on html, php would come easier.

Thanks for all the help!!!

Rick :)

08-22-2005, 07:16 AM
technically for a bg it shouldn't be this:

<style type="text/css">
body { background-image: url(images/dbh_page.jpg) }

but this:

<style type="text/css">
body { background-image: url('images/dbh_page.jpg')}

you do need to add the ' '

08-22-2005, 07:36 AM
Not really. I never use quotes, and it's not defined anywhere that you need to.

08-22-2005, 12:55 PM
Yup, you shouldn't use quotes because some browsers will have trouble with it if you use them. ;)

09-22-2005, 05:45 AM

its just correct form.

09-22-2005, 06:19 AM
w3schools doesn't set the standards w3c does. If you really want to get technical read the spec (http://www.w3.org/TR/REC-CSS2/colors.html#q2).