Jump to content

Archived

This topic is now archived and is closed to further replies.

coldkill

*SOLVED* Background images

Recommended Posts

OK i have a stylesheet with the attributes for a list item but it doesn't display a background image for that item although the list lines up correctly and shows how it should incl. text colour etc.

Any ideas? Heres the HTML generated by a PHP script.
It's only one list item it does have all the required tags etc.

Thanks in advance,
Cold
[code]<li>
<div id="mhead">
    <a href="#" title="Assault AirLift: Brief" onclick="hide_toggle( 'linkcat2' )">Brief</a>
</div>
<div id="menu">
    <ul id="linkcat2" style="display:">

     <li><a href="http://www.assault-airlift.com/index.php?module=races" title="Assault AirLift: Meat Bags, Greenlings and toy soldiers">Survivors</a></li>
        <li><a href="http://www.assault-airlift.com/index.php?module=features" title="Assault AirLift: Driving around IS A FEATURE!">Features</a></li>
        <li><a href="http://www.assault-airlift.com/index.php?module=enemies" title="Assault AirLift: CHARGE!">Enemies</a></li>
        
    </ul>
</div>
</li>[/code]

and heres the CSS
[code]/*
##Menu definitions
*/
.nav
{
    width:130px;
    float:left;
    list-style-image: none;
    list-style-type: none;    
}
#mhead ul
{
    margin: 0;
    padding: 0;
    list-style-type: none;
}

#mhead li {
    margin: 0 0 .2em 0;
    text-indent: 10px;
}

#mhead a
{
    display: block;
    color: #000000;
    background-image:url(/images/backgrounds/cat.jpg);
    width: 130px;
    padding: .2em .8em;
    text-decoration: none;
}

#mhead a:hover
{
    background-image:url(/images/backgrounds/cathov.jpg);
    color: #000;
}



#menu ul
{
    margin: 0;
    padding: 0;
    list-style-type: none;
}

#menu li {
    margin: 0 0 .2em 0;
    text-indent: 10px;
}

#menu a
{
    display: block;
    color: #666666;
    background-image:url(/images/backgrounds/link.jpg);
    width: 100px;
    padding: .2em .8em;
    text-decoration: none;
}

#menu a:hover
{
    background-image:url(/images/backgrounds/linkhov.jpg);
    color: #000;
}

.menubox{
    width:130px;
}
[/code]

Share this post


Link to post
Share on other sites
OK background colours do work but the images don't any ideas?

Share this post


Link to post
Share on other sites
Ooookay. It works with the style attribute but not with the actual stylesheet if it is in a seperate file. Any ideas?

Share this post


Link to post
Share on other sites
[!--quoteo(post=364926:date=Apr 14 2006, 11:26 PM:name=coldkill)--][div class=\'quotetop\']QUOTE(coldkill @ Apr 14 2006, 11:26 PM) [snapback]364926[/snapback][/div][div class=\'quotemain\'][!--quotec--]
::SOLVED::
[/quote]

care to explain how? its a hit and miss one for me sometimes, as i'm sure sticking '!important' at the end of all my definitions is not necessarily the best way...

cheers
Mark

Share this post


Link to post
Share on other sites
it's sometimes the path with me. I tried the paths but that was the problem. When you are testing background images if you right click where it is supposed to be (and it's not) and click view bg image and see where it is trying to get it from. With a div it should be able to have a background image.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.