我确信对此有一个非常简单的解释,但我似乎无法弄清楚,希望能得到一些帮助。
尽管所有数字似乎加起来,并且基本上没有任何填充或边距,但我的主要部分(由#main 和#rightnav 组成)比我的标题更宽。
我错过了什么?
<head>
<style type="text/css">
body {
background: url('cwbg.jpg');
text-align: center;
border: 0;
padding: 0;
margin: 0;
}
a {
border: 0;
text-decoration: none;
}
img {
vertical-align: top;
}
#container {
width: 800px;
height: auto;
margin: auto;
}
#header {
width: 800px;
height: 100px;
margin: auto;
padding-top: 50px;
}
#main {
width: 650px;
height: 700px;
float: left;
}
#rightnav {
width: 150px;
height: 700px;
float: left;
padding-top: 7px;
}
#rightnav ul {
list-style-type: none;
padding: 0;
margin: 0;
}
#rightnav img {
float: left;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<img src="header.png" alt="Christopher James Wilson">
</div>
<div id="main">
</div>
<div id="rightnav">
<ul>
<li><img src="navslices/images/menu_01.png" /></li>
<li><img src="navslices/images/menu_02.png" /></li>
<li><img src="navslices/images/menu_03.png" /></li>
<li><img src="navslices/images/menu_04.png" /></li>
<li><img src="navslices/images/menu_05.png" /></li>
<li><img src="navslices/images/menu_06.png" /></li>
<li><img src="navslices/images/menu_07.png" /></li>
<li><img src="navslices/images/menu_08.png" /></li>
<li><img src="navslices/images/menu_09.png" /></li>
<li><img src="navslices/images/menu_10.png" /></li>
<li><img src="navslices/images/menu_11.png" /></li>
<li><img src="navslices/images/menu_12.png" /></li>
<li><img src="navslices/images/menu_13.png" /></li>
<li><img src="navslices/images/menu_14.png" /></li>
<li><img src="navslices/images/menu_15.png" /></li>
<li><img src="navslices/images/menu_16.png"></li>
</ul>
</div>
</div>
</body>