2014-04-24 88 views
0

我在Safari上與this page上的圖像位置有問題。CSS和Safari:圖像位置

首先,在Chrome,Firefox和Internet Explorer的結果是正確的: Result on on Chrome, Firefox and Internet Explorer

但在Safari瀏覽器存在一個問題: Result on Safari

還有就是CSS:

span.boy_hand { 
    background:url(../img/hand_png.png) no-repeat; 
    height:35px; 
    width:51px; 
    position:fixed; 
    top:470px; 
    margin-left:-32px; 
} 

你能告訴我它來自哪裏嗎?

回答

1

只需使用left屬性而不是margin-left將圖像設置在正確的位置。 不同的瀏覽器會被猜測爲不同的位置固定元素。所以bext pactice將包括您的元素的左側和頂部屬性

span.boy_hand { 
background:url(../img/hand_png.png) no-repeat; 
height:35px; 
width:51px; 
position:fixed; 
top:470px; 
left:32px; /* Set left property as per your need,I just simple reused your code */ 
}