treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Image bg not showing in my ul id tag

  • This is driving me insane and I feel so dense, even went to sleep on it and still having the same problem.

    Why is my page not showing ul bg pls?

    I was following chrises first psd to html and already having problem.

    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
    <html xmlns=\"http://www.w3.org/1999/xhtml\">
    <head>
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
    <title>Viral Marketing</title>
    <link href=\"css/vm.css\" rel=\"stylesheet\" type=\"text/css\" />
    </head>

    <body>




    <ul id=\"nav\">
    <li><a href=\"#\">Home</a></li>

    <li><a href=\"#\">Creating Campaign</a></li>
    <li><a href=\"#\">Pros and Cons</a></li>
    <li><a href=\"#\">Tools and Blogs</a></li>
    </ul>



    </body>
    </html>

    vm.css


    @charset \"utf-8\";

    * {
    margin: 0;
    padding: 0;
    }


    body {
    font-family: Verdana, Geneva, sans-serif;
    background:#ffff00 url('../images/vminterfacebg.png') repeat-x;

    }


    ul# nav {
    height: 118px; width: 940px;
    margin: 0 auto;
    background:url('../images/vminterface_header.jpg') no-repeat;
    }





    Thanks.
  • If your images are not showing in any browser, then the path to them is incorrect. Remove the ' ' from the url('../images/vminterfacebg.png'), and make sure that everything is written in the same case and that there are no typos. The css file is looking outside it's own folder for a folder called images
  • Your code:
    ul# nav {
    height: 118px; width: 940px;
    margin: 0 auto;
    background:url('../images/vminterface_header.jpg') no-repeat;
    }


    Try making it "ul#nav".
  • Thanks Jamy that did it, can't believe the space made al the difference. Cheers