-
清除浮動: 1.clear:both 2.overflow:hidden查看全部
-
width的像素不填滿整個寬度就會出現白色的啦! left和right的位置通過text-align:left來控制?。?! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>二列布局</title> <style type="text/css"> body{ margin:0; padding:0; font-size:30px; font-weight:bold} div{ text-align:center; line-height:50px} .main{ width:960px; height:600px; margin:0 auto} .left{ width:300px; height:600px; background:#ccc;float:left;text-align:left;}/*左浮動樣式*/ .right{ width:640px; height:600px; background:#FCC;float:right; text-align:left;}/*右浮動樣式*/ </style> </head> <body> <div class="main"> <div class="left">left</div> <div class="right">right</div> </div> </body> </html>查看全部
-
三列布局: .left{width:200px;height:800px;color:#ccc;position:absolute;left:0;top:0;} .middle{height:800px;color:#345;margin:0 310px 0 210px} .right{width:300px;height:800px;color:#999;position:absolute;right:0;top:0}查看全部
-
清除浮動有兩種方法:1.clear:both 2.overflow:hidden查看全部
-
之所以用margin定義中間的盒子是因為left和right分別用了position定位 那么就是說已經脫離了標準文檔流 只有中間的middle在標準文檔流里面 用margin定義很合適查看全部
-
div 嵌套 疊壓 緊靠查看全部
-
混合布局,float:left 向左進行浮動查看全部
-
一列布局,關鍵是對于div的使用,margin:0 auto可以使得div自動居中查看全部
-
分欄又叫做分列,常見的布局有:一列布局、兩列布局、三列布局、混合布局查看全部
-
藝術與技術完美融合的關鍵崗位查看全部
-
寬度自適應:按照百分比設定;水平居中的布局:margin:0 auto查看全部
-
clear:both 清除浮動查看全部
-
三列布局: left{weith:200px;position:abusolute;left:0px;top:0px;} middle{margin:0 210px 0 310px} right{weight:300px;position:abusolute;right:0px;top:0px;}查看全部
-
margin:0 auto;使元素水平居中。查看全部
-
三列布局:left{weith:200px;position:abusolute;left:0px;top:0px;} middle{margin:0 210px 0 310px} right{weight:300px;position:abusolute;right:0px;top:0px;}查看全部
舉報
0/150
提交
取消