看板 Web_Design 關於我們 聯絡資訊
各位大大好!我想詢問一下CSS float的觀念 在網上看到教學說三個框(A,B,C)中的第一個框A向左浮動的話 因為浮動脫離了原本的框架,因此他會覆蓋在B上 像這樣 => B C 但我實驗卻變這樣 => AB C 網上內容網址:http://www.w3school.com.cn/css/css_positioning_floating.asp (第3張圖片) 我測試的程式 : <style> #test{ width:300px; border:double 10px black; } #A {float:left;} #B {/*float:left;*/} #C {/*float:left;*/} #clear {clear: both; } </style> <div id="test"> <img id="A" src="http://upload.wikimedia.org/wikipedia/commons/8/80/A-Caracas.png" width="100px" height="100px" /> <img id="B" src="http://upload.wikimedia.org/wikipedia/commons/a/ab/B-Autonorte.png" width="100px" height="100px" /> <img id="C" src="http://www.mommybknowsbest.com/wp-content/uploads/2010/01/thumb_c.jpg" width="100px" height="100px" /> </div> -- Aman ia vida 地下飛行 blog: http://luo74128.blogspot.com/2010/07/blog-post.html 我: http://www.wretch.cc/album/luo74128 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 222.126.156.188
xiphoid:就...寫錯了。position: absolute;才會疊上去 05/18 10:30
luo74128:請問一下你的意思是該網站寫錯了? 05/18 10:32
xiphoid:嗯 網站寫錯 05/18 10:33
luo74128:阿~謝謝啦!~我搞了半天了!!太感謝妳了 05/18 10:49
sycc:XD 05/18 14:24
EROS4:它想講的可能是浮動在親元素上吧 因為沒有clear-fix的話 長 05/18 14:37
EROS4:高度失效就像浮在他上面一樣XD 05/18 14:38