Javascript 溢出-x:可见;不适用于溢出-y:自动;任何解决方法?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10903084/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 03:30:06  来源:igfitidea点击:

overflow-x: visible; doesn't work with overflow-y: auto; any workaround?

javascriptcssoverflow

提问by Toni Michel Caubet

i am trying

我在尝试

.item {
   width: 100px;
   overflow-x: visible;
   overflow-y: auto;
}

But vertical overflow:auto seems to override horizontal's

但垂直溢出:自动似乎覆盖水平的

fiddle: http://jsfiddle.net/xcUTV/

小提琴:http: //jsfiddle.net/xcUTV/

Is there any workaround for this? even with a bit of javascript

有什么解决方法吗?即使使用一些 javascript

采纳答案by tibo

You cannot, that is written in the spec.

你不能,这是写在规范中的。

Have a look here : https://stackoverflow.com/a/6433475/1343096

看看这里:https: //stackoverflow.com/a/6433475/1343096

Since it is written in the spec, I am 99% sure that it is impossible to do.

由于它是写在规范中的,我 99% 肯定这是不可能做到的。