Hi,
Got an unordered list with 100% width, with 5 list items of 20% width
styled to fill the width of the container element.
Renders fine in Mozilla, but when you change the size of the window in
IE, the last item in the list has a nasty tendency to wrap down to the
next line (and stay there).
I can hack it (imperfectly) by setting the width of the list items to
19.9%, but I was wondering whether anyone has a more elegant solution
that they might be kind enough to direct me to?
Thanks in advance.
Example HTML to reproduce:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>CSS test</title>
<style>
body
{
font-size: 80%;
font-family: Tahoma, Verdana;
margin: 0;
padding: 0;
}
#globalnav
{
width: 100%;
margin: 0;
padding: 0;
}
li.globalheadin g
{
width: 20%;
}
#globalnav li
{
list-style: none;
display: inline;
background: yellow;
height: 20px;
}
#globalnav a
{
text-decoration: none;
display: block;
text-align: center;
}
</style>
</head>
<body>
<ul id="globalnav" >
<li class="globalhe ading">
<a href="http://www.foo.com/">Group</a>
</li>
<li class="globalhe ading">
<a href="http://www.foo.com/australia/">Australia </a>
</li>
<li class="globalhe ading">
<a href="http://www.foo.com/asiapacific/">Pacific Asia
Central Europe</a>
</li>
<li class="globalhe ading">
<a href="http://www.foousa.com/">the Americas</a>
</li>
<li class="globalhe ading">
<a href="http://www.foo.com/europe/">Europe</a>
</li>
</ul>
</body>
</html>
Got an unordered list with 100% width, with 5 list items of 20% width
styled to fill the width of the container element.
Renders fine in Mozilla, but when you change the size of the window in
IE, the last item in the list has a nasty tendency to wrap down to the
next line (and stay there).
I can hack it (imperfectly) by setting the width of the list items to
19.9%, but I was wondering whether anyone has a more elegant solution
that they might be kind enough to direct me to?
Thanks in advance.
Example HTML to reproduce:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>CSS test</title>
<style>
body
{
font-size: 80%;
font-family: Tahoma, Verdana;
margin: 0;
padding: 0;
}
#globalnav
{
width: 100%;
margin: 0;
padding: 0;
}
li.globalheadin g
{
width: 20%;
}
#globalnav li
{
list-style: none;
display: inline;
background: yellow;
height: 20px;
}
#globalnav a
{
text-decoration: none;
display: block;
text-align: center;
}
</style>
</head>
<body>
<ul id="globalnav" >
<li class="globalhe ading">
<a href="http://www.foo.com/">Group</a>
</li>
<li class="globalhe ading">
<a href="http://www.foo.com/australia/">Australia </a>
</li>
<li class="globalhe ading">
<a href="http://www.foo.com/asiapacific/">Pacific Asia
Central Europe</a>
</li>
<li class="globalhe ading">
<a href="http://www.foousa.com/">the Americas</a>
</li>
<li class="globalhe ading">
<a href="http://www.foo.com/europe/">Europe</a>
</li>
</ul>
</body>
</html>
Comment