-
網頁居中 margin:0 auto;查看全部
-
為什么footer塊會跑到head塊下面了? 由于main塊沒有設置高度,里面的元素(left塊,right塊)又被設置成了浮動顯示,所以main塊沒有被撐開,就像一條線一樣緊貼在head塊的下面,所以footer塊會越位跑到head塊下面。 清除浮動影響的方法: 1.main中設置overflow:hidden; 2.在footer中添加clear:both; 3. 在footer中添加width:100%;overflow:hidden;查看全部
-
position:absolute;查看全部
-
三列布局的常規自適應排列:左、中向左浮動,右向右浮動實現。<br> 三列布局的特殊排列:左右固定了像素,則在左樣式里面用position:absolute;left:0;top:0; 右樣式里面用:position:absolute;right:0;top:0;<br> 中間樣式:margin:0 300px 0 200px; 想要是三列之間留出空白,則可以把中間的margin:0 310px 0 210px;留出一部分空白就可。查看全部
-
現代網頁不同于以往紙媒的特點:1.網頁寬度自適應。2.網頁的長度可以無限延長。 布局分為:一列布局,二列布局,混合布局。查看全部
-
.top{height:80px;background-color:#ccc;} .main{height:300px;background:red;position:relative;} .left{height:300px;width:200px;float:left;background:blue;} .right{height:300px;background:#ccffcc;position:absolute;left:210px;right:0px;} .foot{height:80px;background:#cc3300;}查看全部
-
由于main這塊沒有設置高度,而且left和right被設置成了浮動樣式,導致main只是在head下面呈現一條線,所以footer才會在head底下查看全部
-
清除浮動為clear:both查看全部
-
三列布局如果是固定的寬度,可以用float;但是如果是其中有一個寬度不確定則應該用position:absolute。查看全部
-
<style type="text/css"> body{ margin:0; padding:0; font-size:30px; color:#fff} .top{height:100px; background:#ccc; margin:0 auto} .main{height:500px; background:red; margin:0 auto} .left{width:200px; height:500px; background:blue; position:left;} .right{height:500px; width:100%; background:#cec; position:absolute; left:210px} .foot{height:50px; background:#e63; clear:both;} </style>查看全部
-
網頁的特點: 可以自適應 長度可以無限延長查看全部
-
clear:both; 清除浮動 margin:600px 0 0 0; /*600px指的是main的高度*/ 清除浮動 .main{height:600px; ...} 通過給main設置高度清除浮動查看全部
-
margin:0 310px 0 210px; 順時針方向 position:absolute; 絕對定位 position:relative; 相對定位查看全部
-
margin:0 auto; 元素居中查看全部
-
body{margin:0;padding:0} 清除格式查看全部
舉報
0/150
提交
取消