我在开发网页时遇到问题。
Firefox 或 Internet Explorer 都不会呈现我期望的以下代码片段的行为:
<div
style="overflow-x: visible; overflow-y: auto; width: 200px; height: 200px; border: 1px solid #F00;">
<div style="width: 300px; height: 300px; background-color: #0F0;"> </div>
</div>
我期望能够看到容器 div 的 x 侧溢出的内容,但看不到容器 div 的 x 侧溢出的内容底部(带有滚动条以查看更多内容)。相反,我看到的是 x 滚动条和 ay 滚动条。
注意:对 firebug 中计算的样式属性的检查表明,firefox 正在使用 overflow-x: auto;
作为容器。
这种行为是预期的吗?我知道请求在我自己的内容之上放置滚动条存在一些含糊之处(例如,我的水平内容将超过垂直滚动条,因此必须覆盖某些内容)。
那么我所经历的行为符合标准吗?
I am having an issue while developing a web page.
Neither Firefox or Internet Explorer will present the behavior that I expect for the following code snippet:
<div
style="overflow-x: visible; overflow-y: auto; width: 200px; height: 200px; border: 1px solid #F00;">
<div style="width: 300px; height: 300px; background-color: #0F0;"> </div>
</div>
What I would expect would be to be able to see the content that overflows on the x side of the container div, but not the content that overflows on the bottom (with a scrollbar to see more). Instead, what I see is an x scrollbar and a y scrollbar.
Note: an inspection of the computed style properties in firebug reveals that firefox is using overflow-x: auto;
for the container.
Is this behavior expected? I understand that there is some ambiguity about requesting to put a scrollbar on top of my own content (e.g. that my horizontal content would go past the vertical scroll bar, so that would have to cover some of the content).
So is the behavior that I am experiencing standards compliant?
发布评论
评论(1)
好吧,我该死,我决定检查 CSS(3) 规范对此有何规定,并且 它说:
所以,简而言之,是的,我所经历的完全是预期的行为。
来源:CSS 基本盒模型 W3C 工作草案 2007 年 8 月 9 日(就在示例之后)
Well, I will be damned, I decided to check what CSS(3) spec had to say about this, and it says:
So, in short, yes, what I was experiencing was entirely the expected behavior.
Source: CSS basic box model W3C Working Draft 9 August 2007 (just after the example)