coldkill Posted April 13, 2006 Share Posted April 13, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/7347-solved-background-images/ Share on other sites More sharing options...
coldkill Posted April 14, 2006 Author Share Posted April 14, 2006 OK background colours do work but the images don't any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/7347-solved-background-images/#findComment-27088 Share on other sites More sharing options...
coldkill Posted April 14, 2006 Author Share Posted April 14, 2006 Ooookay. It works with the style attribute but not with the actual stylesheet if it is in a seperate file. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/7347-solved-background-images/#findComment-27095 Share on other sites More sharing options...
coldkill Posted April 14, 2006 Author Share Posted April 14, 2006 ::SOLVED:: Quote Link to comment https://forums.phpfreaks.com/topic/7347-solved-background-images/#findComment-27102 Share on other sites More sharing options...
redbullmarky Posted April 16, 2006 Share Posted April 16, 2006 [!--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...cheersMark Quote Link to comment https://forums.phpfreaks.com/topic/7347-solved-background-images/#findComment-27540 Share on other sites More sharing options...
coldkill Posted April 18, 2006 Author Share Posted April 18, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/7347-solved-background-images/#findComment-28035 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.