tags:

views:

377

answers:

3

Basically, I want to make a navigation bar where the current or active tab of the navbar will have a background image of a rounded tab. But, that image doesn't seem to appear. I placed the image at the '#navbar .active a' portion of the CSS code below:

<html>
<head>

<style type="text/css">
#menubar {
    width: 800px;
    height: 40px;
    background:url(../Images/menubar%20copy.jpg);
}
#navbarwrap {
    width: 580px;
    height: 40px;
    margin-left: 16px;
}
#navbar {
    width: 580px;
    height: 40px;
    margin-left: 16px;
}
ul  {
    float:left;
    width:100%;
    padding:0;
    margin:0; 
    list-style-type:none;
    white-space: nowrap;
}
li  {
    float:left;
    width: 94px;
    height: 40px;
    text-decoration:none;
    color:white;
    text-align: center;
    display:inline;
}
a   {
    color: #FFFFFF;
    text-decoration: none;
}
#navbar .active a{
    color: #000000;
    background: url(../Images/tab%20copy.gif) no-repeat;
}
</style>

</head>

    <body>
    <div id="menubar">
        <div id="navbarwrap">
        <div id="navbar">
         <ul>
      <li class="active"><a href="...">Link one</a></li>
      <li><a href="...">Link two</a></li>
      <li><a href="...">Link three</a></li>
      <li><a href="...">Link four</a></li>
         </ul>
        </div>
            </div>
    </div>

    </body>
    </html>
+1  A: 

Without image, your code works. So it could just be a image path problem.

MickTaiwan
A: 

Have you checked the file paths?

The way I read that one, you have your file in a subdirectory that is a sibling to 'Images'

i.e.

http://host/subdir/menu.html will look for the image as http://host/Images/tab%20copy.gif

Also, you should verify the case. Most webservers do distinguish between Images and images

Jimmy Stenke
A: 

Does the image in #menubar work? If it doesn't, this is probably just a path error.

Are you sure your "Images"-folder is located one folder above the page you're working on? Seeing as the rest of the code works except for the images, I can only imagine that this is an error caused by an incorrect path.

Jesper Karsrud