2017-08-08 14 views
0

我有一個在Chrome中正確定位的元素(工作正常),但在Safari中它的關閉了50%。一般的CSS並不妨礙我,但這是一個。我建立了所有的反應,這應該不會對CSS產生影響(我只是提到這只是爲了參考)。CSS元素的定位在Safari中移動了一半(但在Chrome中很好)

對我有問題的代碼是:

margin-left: 50px; 
background-color: white; 
transform: rotate(120deg); 
height: 38px; 
width: 38px; 
border-radius: 50%; 
color: white; 
position: absolute; 
background: white; 
transition: all 250ms; 
-webkit-transition: all 250ms; 
overflow: hidden; 

編輯HTML ADDED

<div> 
    <div class="jbRhCt" style="align-items: center; position: absolute; width: 100%; margin: 0px; padding: 0px; justify-content: center;"> 
    <div class="dbgKej"> 
     <div class="fCJbKH" style="background: rgb(31, 139, 179);"> 
     <div class="ijNdlz" style="margin-left: 26px;"> 

     </div><div class="hOzhhR" style="margin-left: 72px;"> 

     </div><div class="bPQgoG" style="margin-left: 120px;"></div> 
     <div class="dMJdoh" style="background: white; transform: rotate(120deg); margin-left: 50px;"> 
      <div class="czTFjn" style="opacity: 1;"></div> 
      <div class="bbrObs" style="opacity: 1;"></div> 
      <div class="ftVltL" style="opacity: 1;"></div> 
      <div class="fqOkrX" style="opacity: 0;"><div class="enUBsj" style="opacity: 0;"></div> 
      <div class="bSIUmO" style="opacity: 0;"></div></div></div> 
      <p class="iWgihJ" style="margin-left: -40px; color: white;">The Light!</p> 
      </div> 
     </div> 
     </div> 
    </div> 

這是關閉的頂部和右側,和我不確定爲什麼。作爲參考,在Chrome中,這是它的外觀(白色月亮)

enter image description here

而且在Safari它看起來像這樣

enter image description here

任何想法是怎麼回事?

+1

你可以發佈HTML嗎?即使這只是反應代碼的產生。 – Don

+0

是的一瞬間,我會編輯我的帖子 – sthig

回答

1

很難說沒有相應的html和父元素的css。由於它是絕對定位的,因此可以嘗試添加right: 0;

如果拋出按鈕,請在父元素上使用position: relative;

+0

將html添加到我的原始文章中,將在短短一秒鐘內讀取您的解決方案 – sthig

1

不同的瀏覽器對絕對定位有不同的初始點。因此,請指定座標,例如:right: 0; top: 0;

+0

錯過了'位置:絕對'在那裏。敏銳的眼神 – Don

+0

加入了html。我完全忘了這一點。 – sthig

相關問題