Why isn't the CSS code filling up 100% of the screen? I have 5 columns with a width of 20% floating left.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<style type="text/css" media="screen">
body {
padding: 0;
margin: 0;
}
#container {
width: 100%;
background-color: red;
height: 42px;
}
ul {
padding: 0;
margin: 0;
width: 100%;
overflow: hidden;
list-style-type: none;
float: left;
white-space: nowrap;
display: inline;
height: 42px;
}
li {
float: left;
width: 20%;
padding: 0;
background-color: #000000;
display: inline;
}
a {
text-decoration: none;
color: #333;
text-align: center;
display: block;
height: 42px;
line-height: 42px;
white-space: nowrap;
overflow: hidden;
font-size: 0.9em;
width: auto;
}
a:hover {
background-color: #ccc;
color: #FFF;
}
</style>
</head>
<body>
<div id="container">
<ul>
<li>
<a href="#">Home</a>
</li>
<li>
<a href="#">Services</a>
</li>
<li>
<a href="#">Portfolio</a>
</li>
<li>
<a href="#">Clients</a>
</li>
<li>
<a href="#">Articles</a>
</li>
</ul>
</div>
</body>
There is always a red area on the right side, but 5*20% = 100%, so that can't be right. What am I missing?
Regards, PP