Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS Background Image

    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

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Code:
    background-image: url(test.jpg);
    Suggested reading: W3Schools.com/css

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New to the CF scene
    Join Date
    May 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by Charlie-uk
    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
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •