Jump to content


Photo

*SOLVED* Background images


  • Please log in to reply
5 replies to this topic

#1 coldkill

coldkill
  • Members
  • PipPipPip
  • Advanced Member
  • 159 posts
  • LocationUnited Kingdom

Posted 13 April 2006 - 08:54 PM

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
<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>

and heres the CSS
/*
##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;
}



You can learn alot from reading the manual

#2 coldkill

coldkill
  • Members
  • PipPipPip
  • Advanced Member
  • 159 posts
  • LocationUnited Kingdom

Posted 14 April 2006 - 09:33 PM

OK background colours do work but the images don't any ideas?


You can learn alot from reading the manual

#3 coldkill

coldkill
  • Members
  • PipPipPip
  • Advanced Member
  • 159 posts
  • LocationUnited Kingdom

Posted 14 April 2006 - 10:04 PM

Ooookay. It works with the style attribute but not with the actual stylesheet if it is in a seperate file. Any ideas?


You can learn alot from reading the manual

#4 coldkill

coldkill
  • Members
  • PipPipPip
  • Advanced Member
  • 159 posts
  • LocationUnited Kingdom

Posted 14 April 2006 - 10:26 PM

::SOLVED::


You can learn alot from reading the manual

#5 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 16 April 2006 - 07:30 PM

[!--quoteo(post=364926:date=Apr 14 2006, 11:26 PM:name=coldkill)--][div class=\'quotetop\']QUOTE(coldkill @ Apr 14 2006, 11:26 PM) View Post[/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
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#6 coldkill

coldkill
  • Members
  • PipPipPip
  • Advanced Member
  • 159 posts
  • LocationUnited Kingdom

Posted 18 April 2006 - 03:55 AM

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.


You can learn alot from reading the manual




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users