html - IE 11 框大小问题(添加边框或填充时不起作用)

标签 html css internet-explorer html-lists

我有一个 <ul>每个<li>应该将可用宽度一分为五:

<ul class="other-languages-products-list">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
    <li>7</li>
    <li>8</li>
</ul>

以下 CSS 在 Chrome 和 Firefox(最新)中工作正常,但在 Internet Explorer 11 中失败,其中最后一个 <li>换行,一行中只显示四个:

.other-languages-products-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.other-languages-products-list li {
    float:left;
    width: 20%;
    box-sizing: border-box;
    border: 1px solid black;
}

.other-languages-products-list:before,
.other-languages-products-list:after {
    display: table;
    content: " ";
}

.other-languages-products-list:after {
    clear: both;
}

这是已知错误还是我遗漏了什么?

最佳答案

发现问题了!我不知道为什么使用谁编码的页面:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

强制 Edge(最新)版本的渲染引擎(当然)解决了这个问题。 IE7 不支持 box-sizing 和许多其他内容。

关于html - IE 11 框大小问题(添加边框或填充时不起作用),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25529810/

相关文章:

html - 如何使高度适合屏幕?

html - 为什么内容会溢出栏目?

javascript - 在 jQuery 中切换类时遇到问题

javascript - 如何根据 JQuery UI 范围 slider 值缩放图像?

jQuery - 检索单个特定类,同时具有多个

c# - 通过 Windows 注册表以编程方式设置代理地址、端口、用户、密码

css - Internet Explorer 7 在 Magento 表单中放置一个不存在的 <UL>

css - Internet Explorer 问题和解决方案

javascript - 堆叠两个 div,每个 div 都有一个 Canvas

jquery - 使用 jQuery 覆盖 CSS 属性