2017-02-16 5 views
3

내 페이지 http://brand2o.com/experience.php에서 라이브 인에서 일하고, 나는 수직이 CSS를 사용하고 링크 내부의 이미지를 중심하지 : 그것은 파이어 폭스와 크롬에서 제대로 작동하고상단 : 50 %; 사파리

img { 
    position: relative; 
    top: 50%; 
    width: 80%; 
    padding: 10%; 
    transform: translateY(-50%); 
} 

을하지만, Safari는 무시하고있는 것 같다 top: 50%; 모두 이유를 모르겠습니다.

여기서 Activision 로고가 강조 표시되어 있으며 볼 수 있듯이 모든 이미지가 너무 멀리 떨어져 있습니다.

The Activision logo is highlighted, and as you can see, all the images are too far up.

답변

2

이 시도 :

main #experienceLogos li a { 
    display: inline-flex; //switch from block display 
    width: 100%; 
    height: 100%; 
} 


main #experienceLogos li img { 
    position: relative; 
    /* top: 50%; Remove this*/ 
    width: 80%; 
    padding: 10%; 
    /* transform: translateY(-50%); Remove this */ 
    -webkit-align-self: center; //safari 7+ 
    align-self: center; 
} 
+1

이 확실히 더 좋아! 그러나 이상하게도 모든 링크가 사파리에서 높이가 100 %인데도 불구하고 리의 전체 높이가 아니므로 각 li 및'align-self : center;에'display : inline-flex; '를 추가했습니다. '각 링크에, 하하. 고맙습니다! – Eriyu

+0

저장 하루! 감사! – KimCrab