javascript - 无序列表中的列表项仅在 Internet Explorer 中重叠,在所有其他浏览器中一切正常

标签 javascript html css internet-explorer vue.js

我创建了以下列表项,它在 chrome 和我尝试过的所有其他浏览器中都运行良好。但是,它在 IE 中不起作用。

This first image is a link to the list working in Chrome

This is the image of the list being bunched up and overlapping in IE

我使用 vue 框架创建了这个应用程序,并且在 Internet Explorer 中遇到了多个问题,这些问题已经得到解决,但我找不到任何其他人遇到过与此类似的问题。 出于某种原因,一旦选择了列表中的元素,列表就会正常工作,但在页面的初始加载时,列表如上图所示。此外,在选择列表中的元素之前,列表无法在 IE 中滚动。

This is the list after an item has been selected and how I would like it to be displayed initially

这是 CSS 列表。

ul{
    background-color: white;
    padding-top:10px !important;
    padding-bottom: 10px !important;
    height: 100%;
    max-height: 450px;
    overflow: auto;
}

用于滚动条的代码在其他浏览器中也能正常工作。

.col-4, .col-8{
    padding:0;
    overflow: hidden;
    overflow-y: -moz-hidden-unscrollable;
}

html{
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

@-moz-document url-prefix() {
    .list-group{
        margin-right: -16px;
    }
}

::-webkit-scrollbar {
    display: none;
}

任何帮助将不胜感激。

最佳答案

只有 IE 仍然遵守 html 元素的溢出规则。尝试改变

html{
    -ms-overflow-style: -ms-autohiding-scrollbar;
}
to 
body{
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

要确定 IE11 在您的开发环境中使用的仿真模式,请使用 f12 开发工具的“仿真”选项卡。 如果您要将旧应用程序升级到较新的框架,请从 html 标记中删除所有表示属性(对齐、滚动、背景等)。

关于javascript - 无序列表中的列表项仅在 Internet Explorer 中重叠,在所有其他浏览器中一切正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51784183/

相关文章:

jquery - 点击跟踪位置

Php生成div,然后隐藏所有的div

html - 调整大小时保持图像对齐

javascript - 如何在浏览器开始下载资源之前操作 DOM?

html - IE8 PNG渐变透明度问题

php - 如何从 manifest.json 链接一些东西

java - 检索数据并插入数据库

javascript - 使用 CSS 或 JS/JQuery 左右滑动两个页面

javascript - 在不阻止其他键盘事件(复制、剪切、粘贴等)的情况下将输入转换为西里尔文

javascript - 为什么取消转义字符串会弄乱我的正则表达式?