SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Strange css not showing in firebug!

    I am trying to show a background image. It isn't appearing and when I check outthe div with firebug it only shows the width and height. I have the css on the page for the time being it will be moved off to an external sheet when I get it working. Why is this image not being shown (the url is fine) Thanks for any pointers

    Code:
    <style type="text/css">
    #vehic  {background-image: url("/admin/project/bckig.jpg") no-repeat};
    </style>
    
    <div id="vehic" style="width:448px;height:340px;">

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Try this:

    Code:
    #vehic  {background: url("/admin/project/bckig.jpg") no-repeat}
    When using background-image, you can only specify url("/admin/project/bckig.jpg"), not "no-repeat", because that's done by background-repeat. The shorthand is just background: which I've used above, and is much simpler.

    Also, I removed the semicolon at the end.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ralph always get confused by background that clears it up, works great!


Bookmarks

Posting Permissions

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