Why my horizontal menu becomes vertical in IE?

ctasik
ctasik used Ask the Experts™
on
How can I keep it horizontal in IE?

html-----
<div id="header">
    <h1>Armina La Manna's portfolio</h1>
              
 
    <ul> 
    
    <li><a href="index.htm" id ="first" class="current">HOME</a></li> 
    <li><a href="curr_act.htm" id ="second" >CURRENT ACTIVITIES</a></li>
    <li><a href="gallery.htm" id="third">GALLERY</a></li>
    <li><a href="theatre.htm" id="fouth">THEATRE</a></li> 
    <li><a href="teaching.htm" id = "fifth">TEACHING</a></li>
    <li><a href="contact.htm" id = "sixth">CONTACT</a></li> 
    </ul>
  </div> 
 
---------css-------------------
 
/* ---------------- header specific styles ----------------*/
 
#header h1 {
	text-indent: -1000em;
	height: 150px;
	width: 800px;
	position: absolute;
	background: url(imgs/name.png) no-repeat right center;
	display: block;
	padding: 1px;
}
 
#header {
	height:180px;
	width:800px;
	position: relative;
	padding: 0;
	margin: 0;
	
		}
 
/* -------------------main navigation menu -----------------------*/
 
#header ul {
	list-style: none;
	position: relative;
	width:700px;
	font-size: 16px;
	padding: 0;
	bottom: 0px;
	right: 0px;
	margin-top: 150px;
	float:right;
				}
 
#header li {display:inline;
	}
	
 
#header li a {display:block;
	}
	
#header li a:link, #header li a:visited {
	background: #FFFFFF;
	/*padding: .2em 12px;*/
	text-decoration: none;
	color:#000000;
	font-family: Arial, Helvetica, sans-serif;
	float: left;
	}		
 
	
#header li a:hover, #header li a:active {
	color:#666666;
	background:#FFFFFF;
		}
	
#header li a.current, #header li a.current:hover, #header li a.current:active {
	color:#999999;
	background: #FFFFFF;
	cursor: default;
	font-weight: bold;	
   }
   
 #container #header #first {
	width: 90px;
}
#container #header #second {
	width: 202px;
}
#container #header #third {
	width: 112px;
}
#container #header #fouth {
	width: 112px;
}
 
#container #header #fifth {
	width: 92px;
}
#container #header #sixth {
	width: 92px;
}
 
#container #header ul li #sixth {
	text-align: right;
	}

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Front-end Developer
Commented:
That's happening because display: inline and display:block are interfering each other, try my snippet.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.0.0b1/build/cssreset/reset-min.css" />
<style type="text/css">
#navigation {
	width:800px;
	margin-top:20px;
	margin-left:20px;
	font:100% normal "Segoe UI", Tahoma, Arial;
}
 
#navigation ul {
	padding:0px;
	margin:0px;
}
 
#navigation li {
	text-align:center;
	list-style:none;
	float:left; /* instead of display:inline */
	line-height:32px;
}
 
#navigation li a {
	color:#0099FF;
	padding-right:8px;
	padding-left:8px;
	text-decoration:none;
	display:block;
}
 
#navigation li a:hover {
	color:#0099FF;
	text-decoration:none;
	background:#f5f5f5;
	display:block;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#">Test link</a></li>
    <li><a href="#">Test link</a></li>
    <li><a href="#">Test link</a></li>
    <li><a href="#">Test link</a></li>
    <li><a href="#">Test link</a></li>
  </ul>
</div>
</body>
</html>

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial