[英]WebKit vs Mozilla vertical alignment of font glyphs in box
[英]Vertical Alignment differences for Webkit vs. Mozilla
好吧,所以在Mozilla中,我的網站看起來像我想要的。 但是,在Webkit瀏覽器中,h1和h2元素下移了約4px。 這是怎么回事?
http://wbjah.com/stackoverflow.htm
h1 {
color: #739e39;
text-shadow: 0px 0px 5px #000;
font-size: 50px;
font-weight: bold;
margin: 0px;
line-height: 50px;
padding: 0px;
}
h1 a:hover{
color: #739e39;
text-shadow: 0px 0px 5px #739e39;
font-size: 50px;
font-weight: bold;
}
h2 {
color: #739e39;
text-shadow: 0px 0px 5px #000;
font-size: 40px;
font-weight: bold;
margin: 0px;
line-height: 40px;
padding: 0px;
}
使用inline-block
而不是float
可能會帶來更好的運氣,因為這避免了不得不用line-height
擺弄。
motto here
之前刪除<br>
#headbox
從float: left;
更改為float: left;
display: inline-block;
line-height: 50px;
從h1
height: 50px;
來自#header
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.