Jump to content

*SOLVED* Background images


coldkill

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]
Link to comment
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
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.