<thead id="jxdzp"><address id="jxdzp"><pre id="jxdzp"></pre></address></thead>

<em id="jxdzp"><span id="jxdzp"></span></em>

    <listing id="jxdzp"><nobr id="jxdzp"><meter id="jxdzp"></meter></nobr></listing>

      <address id="jxdzp"></address>
      <noframes id="jxdzp"><form id="jxdzp"><th id="jxdzp"></th></form>
      <noframes id="jxdzp"><form id="jxdzp"><th id="jxdzp"></th></form>

          訂閱本欄目 RSS您所在的位置: 深山工作室 > DIV+CSS > 正文

          CSS常用網站布局實例

          51add.com 2008/4/24 23:24:18 深山行者 字體: 瀏覽 8674
          CSS常用網站布局實例
          單行一列
          以下是引用片段:
          body { margin: 0px; padding: 0px; text-align: center; } 
          #content { margin-left:auto; margin-right:auto; width: 400px; width: 370px; } 

          兩行一列
          以下是引用片段:
          body { margin: 0px; padding: 0px; text-align: center;} 
          #content-top { margin-left:auto; margin-right:auto; width: 400px; width: 370px;} 
          #content-end {margin-left:auto; margin-right:auto; width: 400px; width: 370px;}

          三行一列
          以下是引用片段:
          body { margin: 0px; padding: 0px; text-align: center; } 
          #content-top { margin-left:auto; margin-right:auto; width: 400px; width: 370px; } 
          #content-mid { margin-left:auto; margin-right:auto; width: 400px; width: 370px; } 
          #content-end { margin-left:auto; margin-right:auto; width: 400px; width: 370px; } 

          單行兩列
          以下是引用片段:
          #bodycenter { width: 700px;margin-right: auto; margin-left: auto;overflow: auto; } 
          #bodycenter #dv1 {float: left;width: 280px;} 
          #bodycenter #dv2 {float: right;width: 410px;} 

          兩行兩列
          以下是引用片段:
          #header{ width: 700px; margin-right: auto;margin-left: auto; overflow: auto;} 
          #bodycenter { width: 700px; margin-right: auto; margin-left: auto; overflow: auto; } 
          #bodycenter #dv1 { float: left; width: 280px;} 
          #bodycenter #dv2 { float: right;width: 410px;}

          三行兩列
          以下是引用片段:
          #header{ width: 700px;margin-right: auto; margin-left: auto; } 
          #bodycenter {width: 700px; margin-right: auto; margin-left: auto; } 
          #bodycenter #dv1 { float: left;width: 280px;} 
          #bodycenter #dv2 { float: right; width: 410px;} 
          #footer{ width: 700px; margin-right: auto; margin-left: auto; overflow: auto; } 

          單行三列
          絕對定位
          以下是引用片段:
          #left { position: absolute; top: 0px; left: 0px; width: 120px; } 
          #middle {margin: 20px 190px 20px 190px; } 
          #right {position: absolute;top: 0px; right: 0px; width: 120px;} 

          float定位一
          xhtml:
          以下是引用片段:
          <div id="warp"> 
          <div id="column"> 
          <div id="column1">這里是第一列</div> 
          <div id="column2">這里是第二列</div> 
          <div class="clear"></div> 
          </div> 
          <div id="column3">這里是第三列</div> 
          <div class="clear"></div> 
          </div> 

          CSS:
          以下是引用片段:
          #wrap{ width:100%; height:auto;} 
          #column{ float:left; width:60%;} 
          #column1{ float:left; width:30%;} 
          #column2{ float:right; width:30%;} 
          #column3{ float:right; width:40%;} 
          .clear{ clear:both;} 

          float定位二
          xhtml:
          以下是引用片段:
          <div id="center" class="column"> 
          <h1>This is the main content.</h1> 
          </div> 
          <div id="left" class="column"> 
          <h2>This is the left sidebar.</h2> 
          </div> 
          <div id="right" class="column"> 
          <h2>This is the right sidebar.</h2> 
          </div> 

          CSS:
          以下是引用片段:
          body {margin: 0;padding-left: 200px;padding-right: 190px;min-width: 240px;} 
          .column {position: relative;float: left;} 
          #center {width: 100%;} 
          #left {width: 180px; right: 240px;margin-left: -100%;} 
          #right {width: 130px;margin-right: -100%;} 

          兩行三列
          xhtml:
          以下是引用片段:
          <div id="header">這里是頂行</div> 
          <div id="warp"> 
          <div id="column"> 
          <div id="column1">這里是第一列</div> 
          <div id="column2">這里是第二列</div> 
          <div class="clear"></div> 
          </div> 
          <div id="column3">這里是第三列</div> 
          <div class="clear"></div> 
          </div> 

          CSS:
          以下是引用片段:
          #header{width:100%; height:auto;} 
          #wrap{ width:100%; height:auto;} 
          #column{ float:left; width:60%;} 
          #column1{ float:left; width:30%;} 
          #column2{ float:right; width:30%;} 
          #column3{ float:right; width:40%;} 
          .clear{ clear:both;} 

          三行三列
          xhtml:

          以下是引用片段:
          <div id="header">這里是頂行</div> 
          <div id="warp"> 
          <div id="column"> 
          <div id="column1">這里是第一列</div> 
          <div id="column2">這里是第二列</div> 
          <div class="clear"></div> 
          </div> 
          <div id="column3">這里是第三列</div> 
          <div class="clear"></div> 
          </div> 
          <div id="footer">這里是底部一行</div> 

          CSS:
          以下是引用片段:
          #header{width:100%; height:auto;} 
          #wrap{ width:100%; height:auto;} 
          #column{ float:left; width:60%;} 
          #column1{ float:left; width:30%;} 
          #column2{ float:right; width:30%;} 
          #column3{ float:right; width:40%;} 
          .clear{ clear:both;} 
          #footer{width:100%; height:auto;} 

          PS:這里列出的是常用的例子,而非研究之用,對一每個盒子,都沒有設置margin,padding,boeder等屬性!
          相關閱讀
          符合標準的正常工作的對聯廣告
          深山文章管理系統 v1.0 bulid 090418
          利用ASP正則查找文章里面的圖片,然后在新窗口打開
          深山旅行社網站管理系統 v1.7
          javascript自動獲取Tags關鍵字
          專注于戶外擴展、商務會議建站解決方案
          深山留言板祈福效果
          uni-app開發的微信小程序在線支付
          共有0條關于《CSS常用網站布局實例》的評論
          發表評論
          正在加載評論......
          返回頂部發表評論
          呢 稱:
          表 情:
          內 容:
          評論內容:不能超過 1000 字,需審核,請自覺遵守互聯網相關政策法規。
          驗證碼: 驗證碼 
          網友評論聲明,請自覺遵守互聯網相關政策法規。

          您發布的評論即表示同意遵守以下條款:
          一、不得利用本站危害國家安全、泄露國家秘密,不得侵犯國家、社會、集體和公民的合法權益;
          二、不得發布國家法律、法規明令禁止的內容;互相尊重,對自己在本站的言論和行為負責;
          三、本站對您所發布內容擁有處置權。

          更多信息>>欄目類別選擇
          百度小程序開發
          微信小程序開發
          微信公眾號開發
          uni-app
          asp函數庫
          ASP
          DIV+CSS
          HTML
          python
          更多>>同類信息
          jquery設置或獲取修改classname
          利用css3.0寫出一個音樂播放的唱片碟盤的效果
          利用css中的scale()實現放大縮小效果
          利用background-color:#000000a8在背景顏色16進制代碼之后加字母加上數字讓背景色透明
          css背景使用base64編碼或者將base64編碼放在img圖片標簽中
          利用css3中的-webkit-font-smoothing把網頁文字的毛邊去掉
          更多>>最新添加文章
          dw里面查找替換使用正則刪除sqlserver里面的CONSTRAINT
          Android移動端自動化測試:使用UIAutomatorViewer與Selenium定位元素
          抖音直播音掛載小雪花 懂車帝小程序
          javascript獲取瀏覽器指紋可以用來做投票
          火狐Mozilla Firefox出現:無法載入您的Firefox配置文件 它可能已經丟失 或是無法訪問 問題解決集合處理辦法
          在Android、iOS、Windows、MacOS中微信小程序的文件存放路徑
          python通過代碼修改pip下載源讓下載庫飛起
          python里面requests.post返回的res.text還有其它的嗎
          更多>>隨機抽取信息
          對MD5加密方式使用者的建議
          深山留言板系統(七夕情人節留言板專用模板) v3.7
          如何提高網站的PR值
          舞陽風情旅行社
          深山行者留言系統V3.0 發布
          javascript表格內移動上下列,可以做成ajax加上動態程序做成上下移動順序
          88国产精品视频一区二区三区