CSS属性"溢出:滚动" IE 11中无法显示滚动条

时间:2016-03-28 11:22:11

标签: css internet-explorer

This is displayed in IE 11, UI does not display scroll bar

This is displayed in chrome, UI display scroll bar

CSS代码如下:

.r-listbox {  
            overflow:scroll;
            width: 200px;
            display: table-cell;
            min-height: 1px;
            padding-left: 10px;
            margin-left: 200px;
            margin-top: -10px;            
        }
.r-listbox 
{
  -ms-overflow-style:scrollbar;
  overflow:scroll;
  width: 200px;
  display: table-cell;
  min-height: 1px;
  padding-left: 10px;
  margin-left: 200px;
  margin-top: -10px; ``           
}

我已添加,但在IE 11中仍然无法显示滚动。 enter image description here

1 个答案:

答案 0 :(得分:1)

你必须为IE编写跨浏览器的CSS,它应该是这样的: -

.r-listbox {
    -ms-overflow-style:scrollbar;
    overflow:scroll;
    width: 200px;
    display: table-cell;
    min-height: 1px;
    padding-left: 10px;
    margin-left: 200px;
    margin-top: -10px;            
}

你应该看看这里

https://msdn.microsoft.com/en-us/library/hh771902(v=vs.85).aspx