打印

求助:怎么让这个鬼东西跟头部对齐啊???

最近开始学div+css,以前做页面都用table+css的,然后在蓝色上开始照教程做,可是那个左边的菜单老是不听话,很倔强的在左边站着,怎么在代码里加东西都是不行,这关过不去后面的其他的叫我怎么有信心学下去啊,高手们找下原因吧,或许对各位高手来说是很小很小的问题呢,谢谢拉~~
附件: 您所在的用户组无法下载或查看附件,您需要注册/登录后才能查看!
珍惜当下~~
这是代码,问题出在哪啊,第一次照着做这鬼东西,好麻烦

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
    background: #F7F7F6 url(images/zbj.gif) repeat-y 50% 0;
    background-attachment: fixed;
    margin: 0;
    padding: 0;
}
#header {text-align:center;
    width:691;
       height:auto;}

h1 {margin:auto;
    width:691px;
       height:81px;
       text-indent: -9999px;
    background-image:url(images/header.gif);
       margin:0;
       padding:0;
}
#left {width:178px;
    float: left;
}
#left01{width:178px;
    float: left;
}
#left01 ul {
    margin:0;
       padding:0;
       list-style-type:none;
       font:bold 12px/22px Verdana, Arial, Helvetica, sans-serif;
       text-indent: 20px;
       letter-spcing:1px;
       border-bottom:1px solid #FFFFFF;
}
#left01 a {width:178px;
    height:22px;
       display:block;
}
#left01 a:link, #left01 a:visited {background:url(images/biao0.gif);
    color:5c604d;
       text-decoration:none;
}
#left01 a:hover {background:url(images/biao.gif);
    color:#A5003B;
       text-decoration:none;
}
#left01 li a#current {background:url(images/biao.gif);
    color:#A5003B;
       text-decoration:none;
}
       
-->
</style></head>

<body>
<div id="header"><img src="images/header.jpg" alt="ximicc" width="691" height="81" /></div>
<div id="left01">
<ul>
<li><a href="#" id="current">Home</a></li>
<li><a href="#">About me</a></li>
<li><a href="#">Contact me</a></li>
<li><a href="#">Articles</a></li>
<li><a href="#">Photo roll</a></li>
</ul>
</div>
<body>
</html>
珍惜当下~~
8个作品不会这个??

.......
Welcome to the tavern of the rising sun!
以前主要做设计拉,制作页面也用的是table ,我们公司到现在还用的这个在,但我看网上太多用div的了,所以想学下拉,呵呵~~人比较笨,没办法
珍惜当下~~

TOP

还在为头像烦恼?还在为不能关注好友动态烦忧?快来蓝色理想家园吧!
你在所有的div外面包一个<div class="wrapper"></div>
然后设置.wrapper样式{margin:0 auto;width:691px;}

因为你#left01的上级元素是body,而body默认宽度是100%的,而#left01是往左浮动的,所以怎么样都会靠近屏幕左边了

TOP

恩,我试下~~
先谢谢了,嘿嘿``
珍惜当下~~

TOP

我的智商果然不行`````````````````
按你指导的加了那代码,还是那鬼样,好郁闷啊 不知道是不是位置加错了......
珍惜当下~~

TOP

好了,我把<div class="wrapper"></div>这个改成<div id="wrapper"></div>就好拉,嘿嘿,太感谢了~~好开心
珍惜当下~~

TOP