BlogJava 首頁 新隨筆 聯系 聚合 管理
            37 Posts :: 64 Stories :: 21 Comments :: 0 Trackbacks
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd"
          >
          <html xmlns="http://www.w3.org/1999/xhtml">
              
          <head>
                  
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                  
          <title>New Web Project</title>
                  
          <link rel="stylesheet" type="text/css" href="index.css" />
              
          </head>
              
          <body>
                  
          <div id="container">
                      
          <div id="header"></div>
                      
          <div id="middleBody">
                          
          <div id="sider" class="column">
                              
          <p>心夢帆影</p>
                              
          <p>心夢帆影</p>
                          
          </div>
                          
          <div id="content" class="column">
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>
                              
          <p>http://www.aygfsteel.com/rongxh7</p>                    
                          
          </div>
                      
          </div>
                      
          <div id="footer"></div>
                  
          </div>
              
          </body>
          </html>


          body {
              margin-top
          :0px;    /* 去除網頁上邊空白 */
          }
          /* 大容器,包含下面所有層 */
          #container 
          {
              width
          :800px;
              margin
          :0px auto;    /* 居中 */
          }
          /* 頭部 */
          #header 
          {
              width
          :100%;
              height
          :100px;
              background
          :#FFE1FF;
          }
          /* 中部,包括左邊區(sider)和右邊內容區(content) */
          #middleBody 
          {
              width
          :100%;
              overflow
          :hidden;    /* 隱藏超出的部分 */
          }
          /* 左邊 */
          #sider 
          {
              width
          :200px;
              float
          :left;
              background
          :#FFE4E1;
          }
          /* 右邊主內容區 */
          #content 
          {
              
          /* 此兩行是#content自適應寬度的關鍵,旨在與右邊界對齊,且不被擠到下面去 */
              padding-right
          :10000px;
              margin-right
          :-10000px;
              float
          :left;
              background
          :#FFFAF0;
          }
          /* #sider和#content共同屬性,此為自適應高度的關鍵,旨在#sider和#content下邊界對齊,且不會露白*/
          .column 
          {
              padding-bottom
          :20000px;
              margin-bottom
          :-20000px;
          }
          /* 底部 */
          #footer
          {
              clear
          :left;    /* 防止float:left對footer的影響 */
              width
          :100%;
              height
          :80px;
              background
          :#FFE4B5;
          }

          運行截圖如下:

          image


          column 可以不用
          middleBody 和sider 使用同樣的背景顏色
          sider和content分別使用20%和80%的寬度屬性,基本可以達到同樣的效果
          posted on 2009-12-14 17:14 xiachang88 閱讀(203) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 无为县| 盐津县| 延安市| 沁阳市| 淮滨县| 绍兴县| 长宁区| 开平市| 和平区| 明溪县| 自贡市| 舟曲县| 伊金霍洛旗| 柞水县| 辽中县| 高平市| 朝阳区| 托里县| 玉田县| 新河县| 观塘区| 庄浪县| 三穗县| 松潘县| 榆树市| 大关县| 巴彦淖尔市| 正镶白旗| 晋州市| 剑河县| 辽源市| 象州县| 衡水市| 京山县| 读书| 阿拉善右旗| 彝良县| 滦南县| 河西区| 驻马店市| 名山县|