html – 在Firefox上的select中缺少border-right

前端之家收集整理的这篇文章主要介绍了html – 在Firefox上的select中缺少border-right前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我将select放入div并使用width和padding-left时,我的选项右边没有边框.更重要的是,只有当select选择宽度为118px且父级有15px的填充时,它才会发生!有人有想法,发生了什么事?

我的简单代码

<!DOCTYPE html>
<html>
<head lang="en">
</head>
<body>
<div style="width: 1000px; padding-left: 15px;">
    <select style="width: 118px;">
        <option>a</option>
        <option>b</option>
        <option>c</option>
    </select>
</div>
</body>
</html>

结果:

这是一个plunker:click

它只发生在Windows上的firefox上.我在40.0.2版本上测试过它

解决方法

-webkit-Box-sizing: border-Box;
-moz-Box-sizing: border-Box;
-ms-Box-sizing: border-Box;
Box-sizing: border-Box;

来源:https://stackoverflow.com/a/11390432/4431269
问题来源:https://bugzilla.mozilla.org/show_bug.cgi?id=924068

而且好用的是GOOGLE!

编辑:(问题来源,解释)

阅读bug报告后,我读到它可能与widows.size或解决方案有关.如前所述,问题可以解决.

原文链接:https://www.f2er.com/html/225669.html

猜你在找的HTML相关文章