Search code examples
phpcsszend-studio

How can I use CSS to set as my <li> background if I'm using the Zend framework?


Everything else 100% works, so I'm 100% positive the error lies in the file path I'm using for the image.

The image doesn't load.

Either

A) I need the file to appear in the Zend workspace, how do I do that.

or

B) My path is wrong.

Here's my file heirarchy:

alt text

And here's my CSS code:

#nav-menu li{
    float: left;
    margin: 0 0.15em;
} 

#nav-menu li a:HOVER{
    background-color: yellow;
}

#nav-menu li a{
    background: url(./img/buttonbackground.jpg) #fff bottom left repeat-x;
    height: 2em;
    line-height: 2em;
    float: left;
    width: 9em;
    display: block;
    border: 0.1em solid #dcdce9;
    color: #0d2474;
    text-decoration: none;
    text-align: center; 
} 

I assure you, the image IS physically there, in my disc, but the path is wrong I guess.


Solution

  • A relative path must be relative to the css file, if the code you posted is in that CSS folder, you need:

    background: url(../img/buttonbackground.jpg) #fff bottom left repeat-x;