-
混合布局,誰先加載怎么實現?查看全部
-
浮動(float)和 絕對定位(position:absolute)可以讓元素脫離標準文檔流。查看全部
-
<!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"> .top{ height:100px; background:#900;} .foot{ height:100px; background:#999} .right{ height:600px; background:#93C; margin-left:220px; } .left{ width:200px; height:600px; background:#9F9; float:left;} </style> </head> <body> <div class="top">top</div> <div class="main"> <div class="left">left</div> <div class="right">right</div> </div> <div class="foot">foot</div> </body> </html>查看全部
-
1.使div居中:設置margin:0 auto查看全部
-
注意把一列改造為兩列時,div的嵌套,若成一大條狀,要注意是否浮動float查看全部
-
三列布局中間要想和兩邊有距離,假如說200px,300px的話就設定為0 310px 0 210px,注意理解,并且注意margin設定必須加上px,除非為0查看全部
-
.left{width:200px;height:500px;background:#ccc;float:left} .main{height:500px;background:blue;} .right{width:500px;height:500px;background:#900;float:right} 這樣是無法在一個行中的,應改為 .left{width:200px;height:500px;background:#ccc;position:absolute;left:0;top:0;} .main{height:500px;background:blue;margin:0 500 0 200;} .right{width:500px;height:500px;background:#900;position:absolute;right:0;top:0}查看全部
-
自適應寬度 設定width:20%查看全部
-
.main{width:50px;height;background;margin:0 auto;}查看全部
-
利用百分數時,注意浮動問題.百分數時浮動與,具體的px浮動起來是有區別的查看全部
-
margin:0 auto 居中查看全部
-
清除浮動的方法: 1.clear:both; 清除兩邊元素的浮動對他的影響 2.overflow:hidden; 在設置了width 或 height 的div中,超出父元素寬度或高度的部分,就隱藏了。查看全部
-
三列布局: 左右列固定寬度,中間列自適應。 左側絕對定位:position:absolute;left:0;top:0; 右側絕對定位:position:absolute;right:0;top:0; 中間寬度定位:margin:0 10px 0 10px; 上右下左,左右調節大小可以緊鄰,也可以有間距查看全部
-
float:left;text-align:left;浮動到左邊,文字左對齊,可以通過改變left為某像素進行縮進; 二列布局里間距可用position:relative:right:-30px查看全部
-
兩列布局利用到了float:left/right 屬性 1.自適應,用百分比%分配寬度,當拖動瀏覽器窗口時,按設置做相應變化,此方法比較少用 2.固定寬度,用px明確指定寬度, 限制左右在父級框中 .main{} .left{float:left;} .right{float:right;} <div class="main">查看全部
舉報
0/150
提交
取消