css - 在 Chrome 中没有边框,但在 Firefox 中有

标签 css google-chrome twitter-bootstrap

我正在使用 Bootstrap 。 你会在图片上看到我的麻烦

来自 Chrome 的屏幕:https://www.dropbox.com/s/1zi8eq7zposn6c9/chrome.png

来自 FireFox 的屏幕:https://www.dropbox.com/s/7mrxarypnsjb63d/firefox.png (抱歉,底部还有另一个带边框的 div)

我的HTML(我觉得没必要全部放在这里):

    <div class="row menu">
    ...
</div>

我的 CSS:

    .menu{
    width:940px;
     height: 30px;
    border-width:0.5px;
    border-top-style:solid;
    border-bottom-style:solid;
    border-color: grey;
    padding:10px;
    background-color: rgb(212,229,190);
     }

最佳答案

由于我的评论有帮助,这里将解决方案作为官方答案。

问题是由于边框设置为半个像素而导致的舍入误差。通过使用至少 1px 的边框宽度,问题将消失(同时出现边框)。

关于css - 在 Chrome 中没有边框,但在 Firefox 中有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11157647/

相关文章:

css - 如何保持导航栏品牌与链接分组

html - 响应式图像 Bootstrap

html - 消除元素之间的水平空白

google-chrome - attr “x-webkit-speech”输入的语言可以不是英语吗?

css - 轮播按钮定位错误chrome和firefox

javascript - ExtJS 5 : spreadsheet drag select with shown cell tooltip

javascript - Bootstrap 选择框样式冲突

css - 仅当表格单元格不为空时如何显示边框底部(CSS)

php - 添加箭头以链接到子项

css - 内联 block 溢出容器外