2016-05-31 1 views
1

빌드하고있는 웹 사이트에서 브라우저 불일치를 없애기 위해 노력하고 있습니다. 내 주요 문제는 화면 너비가 1024px 이상인 경우 Safari에서 헤더가 사라진다는 것입니다. 보이지 않는 이미지 만이 아니며 헤더 안쪽의 모든 것이 사라집니다. 더 좁은 너비와 Firefox, Chrome 및 Opera에서는 괜찮습니다.화면 너비가 1024px 이상인 경우 Safari에서 헤더 div가 사라 집니까?

누구든지이 경험이 있습니까? 누구든지 그것을 고칠 방법을 알고 있습니까? 아래에있는 내 Codepen에

링크 ...

http://codepen.io/ajbater7/pen/aZzmjy

/****************************** 
GENERAL 
******************************/ 


body { 
    font-family: "Montserrat","Open Sans","Arial",sans-serif; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
    box-sizing: border-box; 
} 

.container { 
    flex: 1; 
} 

a { 
    text-decoration:none; 
} 

img { 
    max-width: 100%; 
} 

.top { 
width: 20px; 
height: 20px; 
} 


/****************************** 
CONTAINER 
******************************/ 
.container { 
    padding-left: 5%; 
    padding-right: 5%; 
    margin: 50px auto; 
} 



a, a:visited { 
color: #222222; 
} 

/****************************** 
HEADING 
******************************/ 

.banner { 
    position: relative; 
} 

.name { 
    text-align:center; 
    margin: 0; 
} 
.name a { 
    padding-left: 10px; 
    padding-right: 10px; 
    display: block; 
    color: #fff; 
} 

.video-loop { 
    object-fit: cover; 
    width: 100%; 
    height: 100%; 
    background-color: black; 
    display: none; 
} 

.main-image { 
    object-fit: cover; 
    width: 100%; 
    height: 100%; 
    background-color: black; 
    position: relative; 
} 

.main-header { 
    position: relative; 
    width: 100%; 
    height: 100%; 
} 

.name-nav { 
    margin: auto; 
    position: absolute; 
    bottom: 20px; right: 0; left: 0; 
} 

h1 { 
    text-transform: uppercase; 
    font-family: "Montserrat","Open Sans","Arial",sans-serif; 
    font-weight: normal; 
    font-size: 1em; 
    line-height: 1.2em; 
    letter-spacing: 3px; 
} 

/****************************** 
NAVIGATION 
******************************/ 

.main-nav { 
    text-align: center; 
    padding:5px 10px; 
    margin: 0; 
    font-family: "Montserrat","Open Sans","Arial",sans-serif; 
    font-weight: normal; 
    font-size: .7em; 
    text-transform: uppercase; 
    list-style-type: none; 
    letter-spacing: 2px; 
} 

.main-nav li { 
    margin-top: 8px; 
    margin-bottom: 8px; 
} 

.main-nav a { 
    font-weight: 300; 
    padding-left: 15px; 
    padding-right: 15px; 
    display: block; 
    color: #fff; 
    transition-duration: .5s; 
    transition-property: color; 
} 

.main-nav .selected, .main-nav a:hover { 
    color: #ffae00; 
} 

.main-nav .current { 
    color: #ffae00; 
} 


/****************************** 
GALLERY 
******************************/ 

.feature { 
    text-transform: uppercase; 
    font-size: .7em; 
    margin-bottom: 25px; 
    color: #ffae00; 
    letter-spacing: 2px; 
    text-align: center; 
} 

.gallery { 
    display: flex; 
    flex-direction: row; 
    flex-wrap: wrap; 
    align-content: center; 
    text-align: center; 
    justify-content: center; 
    max-width: 900px; 
    margin: auto; 
} 

.thumb { 
    position: relative; 
    overflow: hidden; 
    max-width: 260px; 
    max-height: 100%; 
    line-height: 0; 
    margin: 10px; 
} 

.image-container img { 
    max-width: 100%; 
} 

.thumb:hover img, .thumb:focus img { 
    transform: scale(1.37); 
    transition-duration: .4s; 
    transition-timing-function: ease-out; 
} 

.photo-overlay { 
    position: absolute; 
    color: #fff; 
    top: 0; 
    right: 0; 
    bottom: 0; 
    left: 0%; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    margin: 0 auto; 
    background-color: rgba(255, 174, 0, .8); 
    text-align: left; 
    opacity: 0; 
    transition: opacity .7s ease-out; 
} 

.photo-overlay:hover { 
    opacity: 1; 
} 

.photo-overlay h3 { 
    font-size: 1em; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    margin: 5px 0; 
    border-bottom: 1px solid #fff; 
    padding-top: 10px; 
    padding-left: 10px; 
    padding-right: 10px; 
    padding-bottom: 15px; 
} 

#top-line1, #top-line2, #top-line3 { 
    border: none; 
    padding-bottom: 5px; 
} 


.photo-overlay p { 
    margin: 5px 0; 
    font-size: .7em; 
    letter-spacing: 1px; 
    padding-top: 5px; 
} 

#behind { 
    padding-top: 0; 
    margin-top: 0; 
} 



/****************************** 
PAGE:ABOUT 
******************************/ 

.about { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
} 

.showreel { 
margin-bottom: 30px; 
} 

.about h3, 
p { 
    font-size: 0.8em; 
    font-weight: normal; 
    text-align: center; 
    letter-spacing: 1px; 
    line-height: 2em; 
} 

/****************************** 
PAGE:CONTACT 
******************************/ 


.contact-info { 
    list-style-type: none; 
    text-align: center; 
    padding: 0; 
} 



.contact-info img { 
    border-radius: 100%; 
    width: 80px; 
    height: 80px; 
} 

.contact-info h3 { 
    text-transform: uppercase; 
    letter-spacing: 2px; 
} 

.contact-info p { 
    font-size: 0.8em; 
    line-height: 2em; 
    letter-spacing: 1px; 
} 

.contact-info li { 
    padding-top: 20px; 
    padding-bottom: 20px; 
} 

/****************************** 
PAGE:FOOTER 
******************************/ 

footer { 
    font-size: 0.7em; 
    text-align: center; 
    clear: both; 
    padding-top: 50px; 
    padding-bottom: 30px; 
    color: white; 
    background-color: #222222; 
    margin-top: auto; 
} 

footer h3 { 
    text-transform: uppercase; 
    letter-spacing: 2px; 

/* 
    text-align: center; 
*/ 
} 

.social-icon { 
    width: 30px; 
    height: 30px; 
    margin: 0 5px; 
    } 

.scroll img { 
    height: 20px; 
    width: 20px; 
} 

.scroll { 
    margin-top: 20px; 
} 

/****************************** 
MEDIA QUERIES 
******************************/ 

@media (min-width: 769px) { 



.container { 
    max-width:85%; 
    margin: 80px auto; 
    padding: 0 10%; 
} 

.main-header, 
.main-nav { 
    display: flex; 
} 

.main-header { 
    flex-direction: column; 
    align-items: center; 
} 

.main-nav { 
    justify-content: center; 
    font-size: 0.8em; 
} 

.feature { 
    font-size: .8em; 
} 

.name-nav { 
    position: absolute; 
    bottom: 20px; 
} 

h1 { 
    font-size: 1.5em; 
} 


.contact-info { 
    display: flex; 
    width: 600px; 
    align-content: center; 
    justify-content: space-between; 
    margin: auto; 

} 

.contact-info li { 
    flex-basis: 25%; 
} 

} 

@media (min-width: 1025px) { 

.main-image { 
    display: none; 
} 

.video-loop { 
    display: unset; 
} 

/* 
.video-loop { 
    visibility: visible; 
} 
*/ 

.main-header { 
    min-height: 100%; 
    min-width: 100%; 
} 

.name-nav { 
    display: flex; 
    flex-direction: row; 
    justify-content: space-between; 
    position: absolute; 
    bottom: 20px; 
} 

.contact-info { 
    width: 800px; 
} 

.name { 
    padding-left: 5%; 
} 

.main-nav { 
    padding-right: 5%; 
} 

.about { 
    flex-direction: row-reverse; 
    justify-content: center; 
    align-items: center; 

} 

.showreel { 
    max-width: 50%; 
    margin-left:40px; 
} 

.info { 
    max-width: 40%; 
    margin-right: 40px; 
    text-align: center; 
} 

} 
+0

몇 가지 일반적인 관찰 : 코드에는 .container {flex : 1; }'. 상위 컨테이너 ('.wrap')가 플렉스 컨테이너가 아니기 때문에 이것은 아무런 효과가 없습니다. 부모와 자식 사이에만 [플렉스 형식 컨텍스트] (https://www.w3.org/TR/css-flexbox-1/#flex-containers)가 * 존재 *합니다. 아이들을 넘어선 플렉스 컨테이너의 자손은 플렉스 특성을 존중하지 않습니다. –

+0

둘째,'.container'에도 백분율 패딩을 사용하고 있습니다. 이 요소가 실제로 플렉스 항목 인 경우, 비율 채우기 및 여백은 권장하지 않습니다. http://stackoverflow.com/a/36783414/3597276 –

답변

0

여기 봐 : 탭에서 flex 클릭 "알려진 문제" - 크롬과 사파리의 높이 (비 플렉스에서) 자녀는 백분율로 인식되지 않습니다. 그러나 Firefox와 IE는 백분율 높이에 따라 어린이를 인식하고 크기를 조정합니다.

관련 문제