【发布时间】:2012-06-01 17:20:48
【问题描述】:
我通过这种方法在我的 CSS 中使用自定义字体:
@font-face {
font-family: 'Gabriola';
src: url('Gabriola.eot');
src: url('Gabriola.eot?#iefix') format('embedded-opentype'),
url('Gabriola.woff') format('woff'),
url('Gabriola.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
.gabriola {
font-size: 20px;
line-height: 20px;
height: 20px;
background: red;
}
<div class="gabriola">Some texty text here</div>
每个浏览器都以自己的方式呈现这些字体,垂直偏移顶部和底部像这样
我做错了什么?谢谢
【问题讨论】:
-
不确定问题出在哪里,但您是否尝试过使用
span代替? (或任何其他内联元素,而不是块元素)
标签: css cross-browser font-face