Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: CSS li Strange?

  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    Adelaide, Australia
    Posts
    472
    Thanks
    3
    Thanked 0 Times in 0 Posts

    CSS li Strange?

    Hi!

    In the following code in IE, the div menucontainer has a bigger height (downwards) then it should be. In all othe rbrowsers, including IE7 it looks fine.
    can someone find me a work around, if it means having a seperate css for this?
    have a look if you're not sure at
    http://www.lynxas.com/clients/bonnetts/test.html

    Code:
    #menucontainer {
    	position:relative;
    	top:0px;
    	height: 23px;
    	width: 498px;
    	margin-right: auto;
    	margin-left: auto;
    	z-index: 5;
    	background-color:#999999;
    
    }
    
    #menu li
    {
    	display: inline;
    	list-style-type: none;
    	padding-right: 10px;
    	margin-left: auto;
    	margin-right: auto;
    	font-family:Arial, Helvetica, sans-serif;
    	font-weight:normal;
    	color: #550000;
    	background-color:#000099;
    	text-decoration: none;
    	z-index: 6;
    
    }
    
    <div id="menucontainer"><div id="menu"><ul id="menu" align="center">
    <li><a href="#">Test</a></li>
    <li><a href="#">Test</a></li></ul></div>
    </div>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Keep things simple. No need for those excess divs.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    margin:0;
    padding:0;
    border:0;
    }
    #menu {
    width: 498px;
    background-color:#999;
    margin:0 auto;
    padding:4px 0;
    list-style:none;
    text-align:center;
    font-family:Arial, Helvetica, sans-serif;
    font-size:14px;
    }
    #menu li
    {
    display: inline;
    padding-right: 10px;
    background-color:#009;
    }
    #menu li a, #menu li a:link, #menu li a:visited {
    text-decoration:none;
    color:#CCC;
    }
    #menu li a:hover, #menu li a:active {
    color:#FFF;
    }
    </style>
    </head>
    <body>
    <ul id="menu">
    	<li><a href="#">Test</a></li>
    	<li><a href="#">Test</a></li>
    </ul>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •