【发布时间】:2013-04-09 12:02:27
【问题描述】:
所以我把这个侧边栏作为表格中的一列,里面有一个垂直滚动的 div。它在 Chrome 中工作得很好,但在 Firefox 中却不行。我已经在网上寻找解决方案,但我尝试过的都没有。在 Firefox 中,它忽略了 100% 的高度,只是将自己向下推,但我不希望这样。我希望它滚动。
这就是我所拥有的
HTML:
<body>
<table class="wrapper">
<tr>
<td colspan="2" class="topbar">
Page title
</td>
</tr>
<tr>
<td class="sidebar">
<div class="listings">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</td>
<td><div id="map_canvas"></div></td>
</tr>
<tr>
<td colspan="2" class="bottom">
hello
</td>
</tr>
</table>
</body>
这是 CSS:
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
body { line-height: 1; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }
html, body {
height:100%; /* needed for container min-height */
}
.wrapper {
width: 100%;
height: 100%;
}
.wrapper .topbar {
background: #000;
color: white;
height: 35px;
}
.wrapper #map_canvas {
background: white;
height: 100%;
width: 100%;
}
.wrapper .sidebar {
width: 400px;
/*height: 100%;*/
background: white;
}
.listings {
min-height: 100px;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
background: grey;
}
.wrapper .bottom {
background: grey;
height: 150px;
}
非常感谢任何帮助
【问题讨论】:
-
哦,我正在使用这个文档类型:
-
您找到解决此问题的方法了吗?我遇到了同样的问题。