I'm having a problem getting my menu items to fit into a fixed width area in IE. It's pretty simple really...
I have a DIV container called "mainFrame" that is 800px wide. Inside of "mainFrame" I have two 400px-wide menu items (more to be added later) that should cozy up to each other. Overall, the list should work similar to the navigation at alistapart.org.
The layout I have looks fine in Mozilla, but in IE the second menu item breaks to the second line, even though there are 400 pixels of space for it to fit. You can see this in action here:
It seems when I change the width of "mainFrame" to 802px instead of 800px it looks great in IE, but then those 2 extra pixels are visible in the layout. Any ideas for how to fix this?
Here is the relevant code:
CSS:
HTML:
I have a DIV container called "mainFrame" that is 800px wide. Inside of "mainFrame" I have two 400px-wide menu items (more to be added later) that should cozy up to each other. Overall, the list should work similar to the navigation at alistapart.org.
The layout I have looks fine in Mozilla, but in IE the second menu item breaks to the second line, even though there are 400 pixels of space for it to fit. You can see this in action here:
It seems when I change the width of "mainFrame" to 802px instead of 800px it looks great in IE, but then those 2 extra pixels are visible in the layout. Any ideas for how to fix this?
Here is the relevant code:
CSS:
Code:
body {
margin:0;
padding:0;
background-image: url(../images/bg.gif);
text-align:center;
}
#mainframe {
border-left:1px solid white;
border-right:1px solid white;
width:800px;
height:100%;
background:white;
margin-left:auto;
margin-right:auto;
}
#menu {
padding:0;
margin:0;
}
#menu UL {
padding:0;
margin:0;
CLEAR:left;
LIST-STYLE-TYPE: none;
TEXT-ALIGN:center;
}
#menu UL LI {
padding:0;
margin:0;
DISPLAY:block;
FLOAT:left;
}
#menu UL LI A {
padding:3px 0px 3px 0px;
margin:0;
BACKGROUND: #00006B;
COLOR: #ffffff;
DISPLAY: block;
FONT-WEIGHT: bold;
text-decoration:none;
TEXT-ALIGN: center;
width:400px;
}
HTML:
Code:
<body>
<div id="mainFrame">
<div id="loggedIn"><asp:literal id="loggedIn" runat="server" /></div>
<img src="../images/banner.jpg"><br />
<div id="menu">
<ul>
<li id="one"><a title="Clients" href="clients.aspx">Clients</A></li>
<li id="two"><a title="Database Admin" href="databaseAdmin.aspx">Database Admin</A></li>
</ul>
</div>
</div>
</body>