簡體   English   中英

Webkit與Mozilla的垂直對齊方式差異

[英]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擺弄。

  1. motto here之前刪除<br>
  2. #headboxfloat: left;更改為float: left; display: inline-block;
  3. 刪除line-height: 50px; h1
  4. 刪除height: 50px; 來自#header

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM