html - 为什么 h1 header 在 Firefox 中看起来比在其他浏览器中更宽

标签 html css

我对这种情况感到困惑。这是 jsfiddle 链接:

http://jsfiddle.net/mddc/jkxy24x5/

这是 HTML:

<h1>Test Header</h1>

这是 CSS:

body {
    font-family: Arial,Helvetica,sans-serif;
    font-size: 0.8em;
}

h1 {
    color: #333333;
    line-height: 1.5em;
}
h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

h1 {
    border: 0 none;
    margin: 0;
    padding: 0;    
}

h1 {
    color: #999999;
    font-family: "Arial Narrow",Arial,Helvetica,sans-serif;
    font-size: 2.3em;
    letter-spacing: 0.03em;
    line-height: normal;
    margin: 0 0 12px;
}

在上面,我从实际网站中提取了准确的 CSS 代码及其顺序。 h1 文本在 Firefox 中看起来比在其他浏览器中更宽。我怎样才能让它在 Firefox 中看起来更窄,就像在其他浏览器中一样?

最佳答案

因为

font-family: "Arial Narrow",

Firefox 无法识别。

但是如果你尝试添加 font-stretch: condensed 就可以修复它

http://jsfiddle.net/jkxy24x5/1/

关于html - 为什么 h1 header 在 Firefox 中看起来比在其他浏览器中更宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25245259/

相关文章:

jquery - 在 div 中卡住表 Bootstrap header

javascript - 如何将包含另一个div的类的变量传递给JS函数并使用它来显示/隐藏相应的div?

html - 兼容模式下的 IE 10 与内联 block 代码混淆

jquery - 更新 100% 宽度元素的大小

css - AngularJS - ng-Style 在指令中更新时不会改变

javascript - 从 Iframe 中存在的父级触发按钮单击

html - 为 ui-select 的每个选项添加不同的 CSS

html - 修复了继承 flex 属性的 flexed div 的子元素

css - 为什么CSS中没有 float 中心?

javascript - 如何在 socket.io 中知道客户端是否关闭了浏览器