...

View Full Version : CSS Background Image



Charlie-uk
05-02-2006, 11:25 AM
I think this might be a really easy question but it's got me totally stuck. I've got an external css which puts 3 different columns on my page. I'd like to set a background image in one of those columns. Code at the mo looks like this...

#lh-col{
position: absolute;
top: 165px;
left: 20px;
width: 150px;
border: 1px solid #E35DB2;
background-image: test.jpg;
color: #333333;
margin: 0px;
padding: 0px;
height: 400px;
}

That is for one of my columns, however the background-image: test.jpg; does not work. Everywhere I look for help I am told to put in a url but the image is saved in the same folder as the external css! Any help would be much appreciated! :)
Thanks, Charlie

Bill Posters
05-02-2006, 11:38 AM
background-image: url(test.jpg);

Suggested reading: W3Schools.com/css (http://www.w3schools.com/css/css_reference.asp)

Charlie-uk
05-02-2006, 11:49 AM
Thanks but I have already looked there :(

It's the url bit I don't understand. Surley I don't need one because the image is in the same place as the external css. I have tried putting the image in a folder then putting the url to the folder but that still doesn't work. Any ideas :confused:

Charlie-uk
05-02-2006, 12:15 PM
Ok the image works as body background. It's as though the columns don't have background functions. If anyone knows how to fix this let me know! I'm too used to working with tables :(

Bill Posters
05-02-2006, 12:17 PM
Thanks but I have already looked there :(

It's the url bit I don't understand. Surley I don't need one because the image is in the same place as the external css. I have tried putting the image in a folder then putting the url to the folder but that still doesn't work. Any ideas :confused:

You have to use the right syntax.
It's not optional.

If the image is in the same folder as the css and the code I posted doesn't work, then you must be making a mistake elsewhere.

Without seeing your code (preferably by posting a url to the site) it's difficult to be more helpful.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum