<html>
<head>
<title>无标题文档</title>
<link href="css.css" rel="stylesheet" type="text/css" media="all" />
</head>

<body>
<div id="container">
    
<div id="header">
        
<div id="menu">
          
<ul>
            
<li><href="#">首页</a></li>
            
<li class="menuDiv"></li>
            
<li><href="#">博客</a></li>
            
<li class="menuDiv"></li>
            
<li><href="#">设计</a></li>
            
<li class="menuDiv"></li>
            
<li><href="#">相册</a></li>
            
<li class="menuDiv"></li>
            
<li><href="#">论坛</a></li>
            
<li class="menuDiv"></li>
            
<li><href="#">关于</a></li>
          
</ul>
        
</div>
        
<div id="banner">
        
</div>
    
</div>
</div>
</body>
</html>
/*基本信息*/
body 
{font:12px Tahoma;margin:0px;text-align:center;background:#FFF;}
a:link,a:visited 
{font-size:12px;text-decoration: none;}
a:hover
{}

/*页面层容器*/
#container 
{width:800px;height:600px;margin:10px auto}

/*页面头部*/
#header 
{background:url(logo.gif) no-repeat}
#menu 
{padding:20px 20px 0 0}
#menu ul 
{float:right;list-style:none;margin:0px;}
#menu ul li 
{float:left;display:block;line-height:30px;margin:0 10px}
#menu ul li a:link,#menu ul li a:visited 
{font-weight:bold;color:#666}
#menu ul li a:hover
{}
.menuDiv 
{width:1px;height:28px;background:#999}
#banner 
{background:url(banner.jpg) 0 30px no-repeat;width:730px;margin:auto;height:240px;border-bottom:5px solid #EFEFEF;clear:both;}

/*页面主体*/
#pagebody 
{width:800px;margin:0 auto;height:400px;background:#CCFF00}

/*页面底部*/
#footer 
{width:800px;margin:0 auto;height:50px;background:#00FFFF}

注意:float 和 clear. 
clear:both;表示清除左右所有的浮动(层)。

div+css入门教程 http://www.xhtmlhelp.net/webdesign/tutorial/5626.shtml

Posted on 2007-03-02 10:54  李通通  阅读(2026)  评论(3编辑  收藏  举报