我使用自定義字體在我的CSS用這種方法: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'代替? (或任何其他內聯元素,而不是一個塊) –
是的..仍然是相同的 – 5ulo