-
兼容IE6不能用浮動,而且當子元素要設定為absolute的時候,父元素要設定relative才可以。 要右側自適應,則左側應該定寬并且position:absolute。 加載順序先右后左div的順序為先右后左查看全部
-
寬度自適應:以百分比形式表現查看全部
-
yes!查看全部
-
http://www.zhihu.com/question/24529373/answer/29135021知乎上的答案查看全部
-
浮動float 和 絕對定位position(absolute)能使元素脫離文檔流查看全部
-
清除浮動有兩種方法:1.clear:both 2.overflow:hidden查看全部
-
文檔流:將窗口自上而下分成一行一行,并在每行中按從左至右的依次排放元素,即為文檔流。 有三種情況使得元素離開文檔流而存在,分別是浮動 絕對布局 固定定位 不脫離文檔流就只有三種情況:塊級、行內和相對定位查看全部
-
<!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> body{ margin:0; padding:0; font-size:30px} div{ text-align:center; font-weight:bold} .head, .main, .footer{ width:960px; margin:0 auto} .head{ height:100px; background:#ccc} .main{ height:600px; background:#FCC} .footer{ height:50px; background:#9CF} </style> </head> <body> <div class="head">head</div> <div class="main">main</div> <div class="footer">footer</div> </body> </html>查看全部
-
清除浮動有兩種方法:1.clear:both 2.overflow:hidden查看全部
-
文檔流:將窗體自上而下分成一行一行,并在每行中按從左至右的挨次排放元素,即為文檔流。 有三種狀況將使得元素離開文檔流而存在,分別是浮動、絕對定位、固定定位。查看全部
-
一列布局簡單明了,通常用于界面的首頁,不適合大量文本讀取。 1.body{margin:0;padding:0}用于清除默認樣式,防止不同的瀏覽器產生差異 2.一列式布局內容頁通常寬度確定,高度自適應 3.可以通過{margin:0 auto}將頁面調整為居中查看全部
-
非常好!查看全部
-
<!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; color:#fff} .top{height:50px; background:#ff0;}/*設置頂部DIV高度50px背景顏色#ff0*/ .main{height:800px; margin:0 auto; background:#f00;}/*設置main主體高度為800px,margin和背景顏色*/ .left{width:200px; height:800px; float:left;background:#fc3}/*老媽說要碎覺了,就不注釋了*/ .right{height:800px; position:absolute;left:200px;} .foot{height:50px; background:#500;} </style> </head> <body> <div class="top">top</div> <div class="main"> <div class="right">right</div> <div class="left">left</div> </div> <div class="foot">foot</div> </body> </html>查看全部
-
<!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; color:#fff} .top{height:50px; background:#ff0;}/*設置頂部DIV高度50px背景顏色#ff0*/ .main{height:800px; margin:0 auto; background:#f00;}/*設置main主體高度為800px,margin和背景顏色*/ .left{width:200px; height:800px; float:left;background:#fc3}/*老媽說要碎覺了,就不注釋了*/ .right{height:800px; position:absolute;left:200px;} .foot{height:50px; background:#500;} </style> </head> <body> <div class="top">top</div> <div class="main"> <div class="right">right</div> <div class="left">left</div> </div> <div class="foot">foot</div> </body> </html>查看全部
-
good查看全部
舉報
0/150
提交
取消