由於某些原因,Firefox和Chrome在使用文字陰影時呈現線條高度不同。使用文字陰影時,Firefox和Chrome中的線條高度不同
CSS:
#tracker {
width:200px;
color:#999;
font:normal 12px Verdana,sans-serif;/* Swapped out Arial with Verdana */
}
#tracker ol {
float: right;
margin: 0;
padding: 0;
white-space: nowrap;
list-style: none;
}
#tracker li {
float: left;
margin: 0 0 0 6px;
padding: 0;
height: 13px;
width: 13px;
color: #666;
background-color: #ccc;
border: 1px solid #c0c0c0;
border-radius: 9px;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
text-align: center;
line-height: 13px;
font-size: 9px;
text-shadow: 1px 1px 1px #fff;
overflow: hidden;
}
#tracker li.current {
color: #fff;
text-shadow: -1px -1px 1px #033e69;
font-weight: bold;
background-color: #13699e;
border: 1px solid #369;
}
#tracker li span{display:none;}
#step1:before{content:"1"}
#step2:before{content:"2"}
#step3:before{content:"3"}
#step4:before{content:"4"}
HTML:
<div id="tracker">
<span class="steps">Steps <span id="current-step">1</span> of 4</span>
<ol>
<li id="step1" class="current"><span>Sender</span></li>
<li id="step2" class="future"><span>Recipient</span></li>
<li id="step3" class="future"><span>Delivery info</span></li>
<li id="step4" class="future"><span>Line items</span></li>
</ol>
</div>
當文字陰影是下面的文字(正數),其壓文本了。
不宜文本是相同的,無論身在何處的陰影渲染? (如FF和IE所示)
我發現的唯一解決方法是在陰影低於(使用正數)時增加行高(從13px到15px),但隨後將其擰緊適用於非webkit瀏覽器(Firefox和IE)。
Demo of the problem ...任何想法?
更新: 我想通了,並已更新我的代碼。這是一個字體問題。我正在使用Arial,但是當我將其更改爲Verdana時,問題解決了。很奇怪!
請避免更新你的問題,而是增加一個答案描繪的解決方案。將編輯恢復到之前的狀態,以便使用提供的代碼再次查看問題。 –
由於我的聲望不到100,系統不會讓我提交八小時的答案。我現在提交了一個答案(下面),但它不會讓我接受它作爲另一個六小時的解決方案。問題仍在我的OP中,與「演示問題」相關聯,我在代碼中評論了更改的內容(字體,從Arial到Verdana)。這還不夠嗎? –
綽綽有餘,社區謝謝:) –