2013-02-04 17 views
1

我在編碼時遇到了一些對齊問題。在Windows中,所有瀏覽器似乎都沒問題。但是當我在Mac Firefox中檢查它時,對齊並不完美。我可以修改它的值一點。但它應該只適用於Mac上的Firefox。目標CSS僅Mac上的Firefox

是否有任何CSS屬性或爲此?

例子:http://jsfiddle.net/9chk5/

.notes { 
display: inline-block; 
position: relative; 
width: 16px; 
height: 16px; 
margin: 0 auto; 
background: #abc; 
} 

.search-notes { 
font-size: 14px; 
color: #484848; 
position: relative; 
top: -20px; 
margin: 0 25px 0 22px; 
} 

和HTML

<div class="notes" style="top:2px"></div><div class="search-notes">This link is used to get information about the visitors from the google organic search. This link is used to get information about the visitors from the google organic search. This link is used to get information about the visitors from the google organic search. This link is used to get information about the visitors from the google organic search. </div> 
    </div> 
+0

你能告訴你的CSS,和你的Firefox版本? – Raptor

+1

讓jsfiddle或輸入您的代碼 – Milind

+0

添加代碼和其他詳細信息 – user1012181

回答

6

您可以使用類來實現你想要的。嗅探用戶的瀏覽器和操作系統,併爲您的特定案例添加一個類。例如。如果用戶在Mac上使用Firefox,則將macFirefox類應用於正文,然後在CSS中使用.macFirefox .yourClass { /*CSS rules*/ }

但是,以交叉瀏覽器的方式應用樣式會更好。

例如你的具體情況改變風格


.search-notes { 
    font-size: 14px; 
    color: #484848; 
    position:absolute; 
    display:inline; 
/* position: relative; 
    top: -20px; 
    margin: 0 25px 0 22px; */ 
} 

應該做的伎倆。

Updated your fiddle