溢出:即使设置高度也自动不起作用
Overflow:auto not working even with height set
在制作网站时,我在存储每个抛出的异常的一侧构建了一个异常持有者。
我想让它滚动,而不是在太多事情出错时扩展网页。
我正在使用CSS和overflow:auto
来更改#error
元素。
网站
#error {
color:red;
display:table;
border:1px solid black;
border-color:black;
height:750px;
width:10em;
overflow:auto;
white-space:nowrap;
}
#important{
vertical-align:top;
border-collapse:separate;
}
<table>
<tr>
<td id='error'>
<div>
<center>Errors:</center>
</div>
</td>
<td id='important'>
Everything here is important. Everything. Please wait while we load.
</td>
</tr>
</table>
从#error
中删除display:table;
并将id='error'
移动到嵌套div
。它将解决问题。
#error {
color: red;
border: 1px solid black;
border-color: black;
height: 10px;
width: 10em;
overflow: auto;
white-space: nowrap;
}
#important {
vertical-align: top;
border-collapse: separate;
}
<table>
<tr>
<td>
<div id='error'>
<center>
Errors:
<br/><br/><br/><br/>
AAA
</center>
</div>
</td>
<td id='important'>
Everything here is important. Everything. Please wait while we load.
</td>
</tr>
</table>
相关文章:
- electronic BrowserWindow的最小高度和宽度在hide()show()方法之后不起作用
- css转换高度不起作用
- 更改第二次推送时不起作用的元素高度
- internetexplorerjavascript样式.高度不起作用
- iframe高度100%不起作用
- jquery .height() 在媒体查询中使用百分比高度时不起作用
- CSS 切换过渡动画,自动高度不起作用
- jScrollPane高度刷新基于我的内容(不起作用)
- 最小高度:不起作用
- 引导滚动间谍偏移高度在火狐中不起作用
- 高度在自调用函数中不起作用
- iframe 自动调整高度大小不起作用
- CSS 高度在火狐中不起作用
- 溢出:即使设置高度也自动不起作用
- 最大高度不'不起作用
- 使用JS的100%页面高度在某些页面上不起作用
- jQuery高度更改在Safari中不起作用
- 为什么css高度不起作用
- Jquery.animate 100%高度不起作用
- 为什么这个Fancybox的高度和宽度不起作用