index.html
///////////////////////////////////////////<!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>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
 <body>
     <div id="container"><!--页面容器-->
          <div id="header"><!--页面头部-->
      </div>
      <div id="pagebody"><!--页面主体-->
           <div id="sidebar"><!--侧边栏-->
           </div>
           <div id="mainbody"><!--主体内容-->
           </div>
      </div>
      <div id="footer"><!--页面底部-->
      </div>
    </div>
 </body>
</html>
/////////////////////////////////////////////////////////////////////////css.css
//////////////////////////////////////////////////////////////////////////*基本信息*/
body {font:12px Tahoma;margin:0px;text-align:center;background:#FFFFFF}
/*页面层容器*/
container {width:100%}
/*页面头部*/
Header {width:800px;margin:0 auto;height:100px;background:#FFCC99}
/*页面主体*/
PageBody {width:800px;margin:0 auto;height:400px;background:#CCFF00}
/*页面底部*/
Footer {width:800px;margin:0 auto;height:50px;background:#00FFFF}
//////////////////////////////////////////////////////////////////////////真是郁闷了,你们看过这个东西没,哪里有错误

解决方案 »

  1.   

    css.cssbody {font:12px Tahoma;margin:0px;text-align:center;background:#FFFFFF}#container {width:100%}#header {width:800px;margin:0 auto;height:100px;background:#FFCC99}#pageBody {width:800px;margin:0 auto;height:400px;background:#CCFF00}#footer {width:800px;margin:0 auto;height:50px;background:#00FFFF}
    .css文件错了  那个id要这样声明  #id{样式}
      

  2.   

    /*基本信息*/
    body {font:12px Tahoma;margin:0px;text-align:center;background:#FFFFFF}
    /*页面层容器*/
    container {width:100%}
    /*页面头部*/
    Header {width:800px;margin:0 auto;height:100px;background:#FFCC99}
    /*页面主体*/
    PageBody {width:800px;margin:0 auto;height:400px;background:#CCFF00}
    /*页面底部*/
    Footer {width:800px;margin:0 auto;height:50px;background:#00FFFF}
    //////////////////////////////////////////////////////////////////////////
    container Header PageBody Footer 都是id,要加#
      

  3.   

    ID 有错误吗  可以用ID CLASS 都一样的
      

  4.   

    id前面要加#,无符号的是html标签。