[問題] height: auto;

看板Web_Design作者 (難道)時間18年前 (2008/03/02 00:41), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
我有以下的 CSS 程式碼: #con { background:#003366; width:300px; height:300px; } #test1 { background:#CCCCCC; width:150px; height:150px; } #test2 { background:#00CC66; width:150px; height:auto; } 當我寫 <div id="con"><div id="test1"></div><div id="test2"></div></div>, 瀏覽器不管是 IE 或 Firefox,test2 區塊的高度都不會自動延伸 (我以為它會自動延伸 150px,因為母組件的高度是 300px,test1 的高度是150px), 想請問怎麼無法自動延伸呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.172.62.231

03/02 01:20, , 1F
高度設100%
03/02 01:20, 1F

03/02 01:39, , 2F
請問是哪裡的高度呢?
03/02 01:39, 2F
文章代碼(AID): #17oOT9VT (Web_Design)