overflow-x:visible; overflow-y:auto;不工作 - 这个标准是否符合? [英] overflow-x: visible; overflow-y: auto; does not work - is this standards compliant?

查看:89
本文介绍了overflow-x:visible; overflow-y:auto;不工作 - 这个标准是否符合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发网页时遇到问题。



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;>& nbsp;< / div>
< / div>

我会期望能够看到溢出在x容器div,但不是在底部溢出的内容(用滚动条看到更多)。



注意:检查firebug中计算的样式属性会发现firefox使用



这个行为是否是预期的?我理解,有一些含糊不清的请求将滚动条放在我自己的内容上(例如,我的水平内容将超过垂直滚动条,所以必须覆盖一些内容)。

$

解决方案

那么,我会遇到符合标准的行为吗?我决定检查什么CSS(3)规范不得不说这个,和它 a>说:


'overflow-x'和'overflow-y'的计算值与
相同指定的值,除了一些与'visible'
的组合是不可能的:如果一个被指定为visible,另一个是
'scroll'或'auto',则'visible' 'auto'。


简而言之,是的,我所经历的是完全的预期行为。



资料来源: CSS基本框模型W3C工作草案2007年8月9日< a>(稍后)


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;">&nbsp;</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?

解决方案

Well, I will be damned, I decided to check what CSS(3) spec had to say about this, and it says:

The computed values of ‘overflow-x’ and ‘overflow-y’ are the same as their specified values, except that some combinations with ‘visible’ are not possible: if one is specified as ‘visible’ and the other is ‘scroll’ or ‘auto’, then ‘visible’ is set to ‘auto’.

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)

这篇关于overflow-x:visible; overflow-y:auto;不工作 - 这个标准是否符合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆