如何将另一个元素内的 div 缩放至 100% 高度和宽度?就我而言,是一个环绕的 td。因为我是一个插件,所以我无法控制页面上的其他 HTML。这是我的 HTML:
<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 应该最大化。有跨浏览器的方法来做到这一点吗?为什么这么复杂?
Look at 这个堆栈溢出问题以及...审查后评分最高的答案在这个问题中,看起来您必须将容器的高度设置为 100%,并将子元素的“min-height, height”设置为 100%。
Go to 这个网站欲了解更多信息 - 下面的 HTML 是该网站的精简版本
<div style="height:100%;">
<div style="min-height:100%; height:100%; background-color:red;">
put your content here
</div>
</div>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)