gpt4 book ai didi

html - 按百分比设置表格行的高度在 Firefox 上不起作用。解决方案?

转载 作者:行者123 更新时间:2023-11-28 11:27:04 25 4
gpt4 key购买 nike

我希望第一行的高度为屏幕的 70%。我在第一行的 div 中将 overflow 设置为 auto,这样滚动条就不会出现在整个网页上,只出现在这个 div 上。我的解决方案适用于 Chrome 和 IE,但不适用于 Firefox:在 Firefox 上第一行的大小超过 70%。有什么解决办法吗?

这是一个 JSFiddle:http://jsfiddle.net/4hyCh/

<body>
<div style="height: 100%;">

<table style="height: 100%;">
<tr>
<td style="height: 70%;">
<div class="mainDiv">
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />AAA AAA<br />
</div>
</td>
</tr>
<tr>
<td>
<div class="footerDiv">
Copyright some company...
</div>
</td>
</tr>
</table>

</div>
</body>

CSS:

html 
{
height:100%;
margin: 0px;
}

body
{
height:100%;
margin: 0px;
font-family: Verdana;
}

.mainDiv
{
background-color: #00FF00;
height: 100%;
overflow: auto;
}

.footerDiv
{
background-color: #FF00FF;
}

最佳答案

找到解决方案:该表需要:

<tbody style="height: 100%;">

关于html - 按百分比设置表格行的高度在 Firefox 上不起作用。解决方案?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21307015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com