Forum Moderators: not2easy
IE 6 for some reason I cannot work out adds 15px of extra space at the right side of the last UL. Pushing the containing div 15px wider than it should be.
Any ideas?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Title</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
body {
color: white;
background-color: #EFEFEF;
}
.container {
width: 800px;
background-color: #FFFFFF;
margin-top: 10px;
height: 400px;
}
ul {
float: left;
width: 180px;
margin-right: 20px;
background-color: red;
}
li {
list-style-type: none;
}
</style>
</head>
<body>
<div class="container">
<ul>
<li>1</li>
</ul>
<ul>
<li>2</li>
</ul>
<ul>
<li>3</li>
</ul>
<ul>
<li>4</li>
</ul>
</div>
</body>
</html>
1. If you add a fifth ul element -
<ul>
<li>5</li>
</ul>
Just before the </body> tag, the fifth element appears under the first and the margin on the forth one behaves like it should in IE.
2. If you replace the margin-right: 20px; style on the ul element with border-right: 20px white solid; you get the result you are aiming for.