-
清除浮動的方式:1.使用空標簽清除,即空標簽可以是div標簽,也可以是p標簽。這種方式是在需要清除浮動的父級元素內部的所有浮動元素后添加這樣一個標簽清除浮動,并為其定義CSS代碼:clear:both。此方法的弊端在于增加了無意義的結構元素。如:.clear{clear:both}...<div class="clear"></div>... 2.使用overflow屬性。 此方法有效地解決了通過空標簽元素清除浮動而不得不增加無意代碼的弊端。使用該方法是只需在需要清除浮動的元素中定義CSS屬性:overflow:auto,即可!也可以用overflow:hidden;”zoom:1″用于兼容IE6,也可以用width:100%。 3.使用after偽對象清除浮動。 該方法只適用于非IE瀏覽器 。具體寫法可參照以下示例。使用中需注意以下幾點。一、該方法中必須為需要清除浮動元素的偽對象中設置height:0,否則該元素會比實際高出若干像素;二、content屬性是必須的,但其值可以為空,藍色理想討論該方法的時候content屬性的值設為”.”,但我發現為空亦是可以的。查看全部
-
三列布局中間自適應,固定兩邊(絕對定位、左右???,中間設置左右margin值查看全部
-
css設置中,浮動(float)和絕對定位(position:absolute)可以讓元素脫離文檔流查看全部
-
清除浮動兩種方法:1. clear:both; 2. overflow:hidden.查看全部
-
div{width:800px;height:500px;margin:0 auto}實現頂寬元素居中的方法。查看全部
-
網頁的特點:自適應界面的寬度;理論上能無限延長。<br> 分欄布局(分列):一列,兩列,三列和混合布局(一列頭部,幾列內容,可以有底部) 前端工程師需要用CSS的浮動和定位完成UI的設計。查看全部
-
清除浮動兩種方法:1. clear:both; 2. overflow:hidden.查看全部
-
清除浮動clear:both;查看全部
-
<!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;margin:0 auto;} .top{width:800px;height:200px;background:#00f;margin:0 auto;} .main{width:800px;height:700px;background:#ff0;position:relative;margin:0 auto;} .left{ width:190px;height:700px;background:#f0f;float:left;} .right{width:600px;height:700px;background:#0ff;float:right;} .foot{width:800px;height:100px;background:#00f;margin:0 auto;} </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>查看全部
-
margin代表上下。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} div{ text-align:center; font-weight:bold} .main,.footer{ width:960px; 【任務1】} .head{ width:100%; height:100px; background:#ccc} .main{ height:600px; background:#FCC;margin:0 auto;} .footer{ height:50px; background:#9CF;margin:0 auto;} </style> </head> <body> <div class="head">head</div> <div class="main">main</div> <div class="footer">footer</div> </body> </html>查看全部
-
一列布局:如百度首頁,不宜放置多行文字,簡潔清晰為主查看全部
-
前端工程師:是一個將藝術與技術融合為一體的門職業查看全部
舉報
0/150
提交
取消