如何縮放div到另一個元素內部的100%高度和寬度?在我的情況下,tround。由於我是一個插件,我無法控制頁面上的其他HTML。這是我的HTML:如何將div縮放到另一個元素內部的100%高度和寬度
<body style="height:100%;">
<table width="600px" height="400px" border="1">
<tr>
<td style="background-color:silver;">Cell 1</td>
<td style="background-color:silver;">
<div style="height:100%; background-color:yellow;">
<div style="min-height:100%; height:100%; background-color:red;">
Cell 2
</div>
</div>
</td>
</tr>
</table>
</body>
因此,應該最大化Cell 2 div。有沒有跨瀏覽器的方式來做到這一點?爲什麼這很複雜?
上面的代碼有什麼問題?只是在FF3和IE6/7中打開它,RED div佔用了整個單元格。 – 2009-02-21 19:10:31