Html 溢出-y 滚动在 IE 11 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45890061/
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-29 14:53:14  来源:igfitidea点击:

overflow-y scroll not working in IE 11

htmlcssinternet-explorerweb-applications

提问by Manas Saxena

Hi I have registration form .I need it to have a vertical scrollbar, I am using the below css:

嗨,我有注册表单。我需要它有一个垂直滚动条,我正在使用以下 css:

.scrollbar{
    overflow-y: scroll;
    height:400px;
}

The above code works for Firefox and Chrome but IE doesnt show up the scrollbar at all . Any idea how to fix this

上面的代码适用于 Firefox 和 Chrome,但 IE 根本不显示滚动条。知道如何解决这个问题

采纳答案by Manas Saxena

It's a bug.

这是一个错误。

See https://msdn.microsoft.com/en-us/library/hh771902(v=vs.85).aspx- you can use -ms-overflow-style:scrollbar;

请参阅https://msdn.microsoft.com/en-us/library/hh771902(v=vs.85).aspx- 您可以使用 -ms-overflow-style:scrollbar;

回答by kiev

Actually this only works as of 5/2018 to have the overflow div contain another element inside of it. The other solutions do not

实际上,这仅适用于 5/2018 以使溢出 div 包含其中的另一个元素。其他解决方案没有

This works

这有效

  <div style="overflow:auto"><p>{{largepiecetext}}</p></div>

This does not

这不

  <div style="overflow:auto">{{largepiecetext}}</div>