看板 Web_Design 關於我們 聯絡資訊
我有三個div 分別為top、menu和content 可是當我content的內容有表格且超過版面時, content的div就會被擠到menu的下方(如圖所示) ■■■■■■■■■■■■■■■■■■■■■■■ ■■■■■■■■■■Top■■■■■■■■■■ ■■■■■■■■■■■■■■■■■■■■■■■ ■■■■■■ ■Menu■ ■■■■■■       ■■■■■■■■■■■■■■■■■■■■■■■■       ■■■■■■■■■Content■■■■■■■■       ■■■■■■■■■■■■■■■■■■■■■■■■ 請問我的css設置有啥問題嗎? 那該如何設置才會正常呢? 謝謝! 原程式碼: <style> #top{ background-color:red; } #menu{ background-color:blue; float:left; width:150px; } #content{ background-color:green; float:left; margin-left:150px; } </style> <div id="top">top</div> <div id="menu">選單</div> <div id="content">內容</div> 修正後: <style> #top{ background-color:red; } #menu{ background-color:blue; float:left; } #content{ float:left; clear:right; } </style> <div id="top">top</div> <div id="menu">選單</div> <div id="content">內容</div> -- 請勿拍打、餵食 http://www.wretch.cc/album/etchen --
yujihinata:content float right然後超過的設隱形 09/22 16:22
etchen:請問設成隱形是甚麼意思呢?是clear嗎? 09/22 16:38
pm2001:float:left; 去掉 09/22 16:38
zz59743p6:overflow:hidden; ←還是這樣= =? 09/22 16:40
kyork:body{overflow-x:auto;} 09/22 16:41
etchen:都不行耶= =~ 09/22 16:46
etchen:k大的不是我想要的:) 09/22 16:47
etchen:另外一個問題是,若我的Top寬度想與Content的寬度一致, 09/22 17:34
etchen:是否要使用到CSS TABLE?? 09/22 17:34
cadmus22:用box 去包 menu 跟 content 09/22 17:35
hilorrk:外面包一層div設width 09/22 20:20
pm2001:我知道為什麼了,你menu的左邊界不是0,你的content絕對爆掉 09/22 20:27
pm2001:就被擠到下面了 09/22 20:27
mycutekevin:content的float改right top加margin-left:memu的寬度 09/22 20:44
※ 編輯: etchen 來自: 218.211.33.46 (09/24 11:44)