此问题与在不同浏览器中呈现字体有关。我惊讶地发现这个问题只在 Chrome 中重现。它在 Firefox、IE8、Safari 甚至 IE6 中运行良好。
示例来了。
下面是代码本身:
<div style="position:absolute;bottom:2px;padding-top: 1px;width:100%;">
<span style="float:left;">
<div id="saveCustomizationButton" class="smallBlueButton">
<span>Speichern</span>
</div>
</span>
<span style="float:right;padding-right:1px;">
<div id="downloadOrPrintButton" class="smallGreenButton smallGreenButtonSmallLetterSpace">
<span>Downloaden oder drucken</span>
</div>
</span>
</div>
div.smallGreenButton span, div.smallGreenButton a {
display: block;
line-height: 14px;
padding: 1px 7px 2px 13px;
}
div.smallGreenButton {
font-family: arial,sans-serif;
font-size: 12px;
font-weight: 600;
}
div.smallBlueButton {
font-family: arial,sans-serif;
font-size: 12px;
font-weight: 600;
}
就是这样。我读过有关 css reset 的文章,并尝试过。任何奇迹——什么都没有改变。我被认为使用的另一种方法是固定容器标签的宽度。但是由于需要维护多个本地化,我不能使用这种方法。
希望smb提出解决方案。或者我需要实现一些特定于浏览器的行为。
等待您的评论。提前致谢。
最佳答案
文本呈现确实因浏览器而异。有时无论我们如何尝试更改呈现方式,我们都不会得到它。你可以阅读this文章如果你想要。它没有为这个问题提供解决方案(我认为没有),但它强调了差异。
关于css - 相同的字体在 Chrome 与 Firefox、IE 和 Safari 中看起来不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14401235/