聖盃佈局方法實例

<!doctype>
<html>
  <head>
    <title>聖盃佈局</title>
    <style>
   body,div{margin: 0;padding: 0;}
       .main { 
       background:red;
       width:100%;
   float:left;
   }
       .left {
           background:yellow;
       width:300px;
   float:left;
   margin-left:-300px;
   }
       .right {
        background: green; 
       width:250px;
   float:left;
   margin-right:-250px;
   }
   #head, #footer {
          height:100px;
          background: #666;
  color: #eee;
          text-align: center;
  clear:both;
       }
       #content{
      padding-left:300px;
  padding-right:250px;
   }
 
</style>
  </head>
  <body>
    <div id='head'>
   header
</div>
<div id='content'>
   <div class='left'>
      lefterretr
   </div>
   <div class='main'>
      main
   </div>
   <div class='right'>
      right
   </div>
</div>
<div id='footer'>
   footer
</div>
  </body>
</html>
聖盃佈局它的目標是左右兩欄定寬,中間那一行流式

wKiom1TtkyDyJ5qGAACn5kfnS_M902.jpg

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章