顯示具有 css 標籤的文章。 顯示所有文章
顯示具有 css 標籤的文章。 顯示所有文章

2010年4月2日

css 小記

研究浮動排列
image

body{
    width:1000px;
    margin: 0 auto;
}
 
.body{
    position: relative;
    padding:5px;
    background-color:red;
}
 
.top{
    position: relative;
    width:100%;
    height:100px;
    background-color:#fff;
}
 
.c{
    position: relative;
    top:5px;
    
    width:100%;
    height:600px;
    background-color:#fff;
}
.main{
    position: relative;
    display:inline-block;
    float:left;
    width:80%;
    top:5px;
    margin-left: 5px;
    border: 2px solid #ff8000;
}
.left{
    position: relative;
    display:inline-block;
    float:left;
    width:18%;
    top:5px;
    margin-left: 5px;
    border: 2px solid #ff8000;
}

 
<div class="body">
    <div class="top">top</div>
    <div class="c">
        <div  class="main">
            main<br>2<br>2<br>2<br>2<br>2<br>2<br>2<br>2<br>2<br>
        </div >
        <div  class="left">
            left<br>1<br>1<br>1<br>1<br>1<br>1<br>1<br>
        </div >
    </div>
</div>

2010年3月31日

CSS 忘光光

人真的是很妙的動物
我還是乖乖的把一些東西記錄下來好了

css

   1: body{
   2:     width:1000px;
   3:     margin:0 auto;
   4: }
   5: #top{
   6:     width:100%;
   7:     height:30px;
   8:     text-align:center;
   9:     background:#833;
  10:     margin:0 auto;
  11: }
  12: #main{
  13:     width:100%;
  14:     margin:0px auto;
  15:     background:white;
  16: }
  17: #sidebar{
  18:     width:25%;
  19:     float:left;
  20:     background:#383;
  21: }
  22: #content{
  23:     width:75%;
  24:     float:left;
  25:     background:#338;
  26: }
  27: #footer{
  28:     width:100%;
  29:     clear:left;
  30:     height:30px;
  31:     background:#833;
  32:     margin:0 auto;
  33: }



   1: <div id='top'>標題</div>
   2:  
   3: <div id='main'>
   4:     <div id='sidebar'>
   5:         邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>
   6:         邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>
   7:         邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>邊欄<br>
   8:     </div>
   9:     <div id='content'>
  10:         主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>
  11:         主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>
  12:         主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>
  13:         主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>主文<br>
  14:     </div>
  15: </div>
  16:  
  17: <div id='footer'>頁底</div>