我遇到了使用DIV來爲我的網站設置內容框樣式的問題。它基本如下所示:無表或無表:帶自定義邊角的Html擴展框
container +--------------------------+ |+--+------------------+--+| ||c1| r1 |c2|| |+--+------------------+--+| || | | || || | | || ||r4| content |r2|| || | | || || | | || |+--+------------------+--+| ||c4| r3 |c3|| |+--+------------------+--+| +--------------------------+
r1,r2,r3和r4的寬度/高度未知。它們都有1px(高或寬)漸變,在背景中重複。
角落有5x5px pngs(圓形,透明背景)。
問題是我不知道內容的寬度或高度,因此不知道r1到r4的寬度或高度。是不是真的有在CSS一個跟你說:
r1 {width: container.width - 2x5px};
我知道這可能與JavaScript來完成,但我想避免這種情況。
在這種情況下使用表格不是更簡單嗎?它看起來像一張桌子:)
使梯度寬/比單個像素高。有些瀏覽器有這個問題,最近我觀察到的是IE8 ... – Guffa 2009-07-27 23:10:50
不,這不是真正的問題。請在表格中回答我的意見 - 答案... – Ropstah 2009-07-28 12:58:16