【发布时间】:2013-08-05 02:48:51
【问题描述】:
我正在构建一个 MDI WEB 应用程序,并有一个由 article 元素创建的窗口,其中包含一个 header 和一个 section 用于内容。由于它是一个 MDI 应用程序,article 设置为absolute,因此它可以与其他窗口重叠。我需要一个滚动条出现在内容部分,而不是 header。
<article id="win3">
<header> … </header>
<section> … </section>
</article>
CSS:
article {
position: absolute;
min-width: 500px;
width: 918px;
margin: 0px;
padding: 0px;
overflow: hidden;
background-color: white;
border-style: ridge;
border-color: #ddd;
border-width: 4px;
}
article>section {
/* reduce diameter of rounded corner to match the inside curve of the border */
border-radius: 10px;
-moz-border-radius: 10px;
display: block;
overflow: auto;
border: none;
width: 100%;
background-color: white;
padding: 10px 10px 10px 20px;
min-height: 50px;
height: 100%;
}
看起来overflow: auto 在 Firefox (v 22) 中被忽略了,但滚动条确实出现在 Chrome 中。
关于如何在内容部分需要时可靠地制作滚动条有什么想法吗?
【问题讨论】:
标签: css dynamic web-applications scrollbar overflow