2016-11-22 1 views
0

http://codepen.io/anon/pen/aBWvMX사업부 높이 (VW 단위는?)

예상되는 동작은 큰 창에서 노란색과 빨간색 div의 서로 옆에 크기 때문이다 IOS 사파리에서 작동하지 않는 작은에서 그들은 위에 스택 및 스크롤입니다.

이 기능은 PC의 Chrome, Firefox, IE에서 작동합니다.

이것은 Mac의 Chrome, Firefox, Safari에서 작동합니다.

Android의 Chrome에서 작동합니다.

IOS 장치의 Chrome 또는 Safari에서는 작동하지 않습니다.

대신 IOS 장치에서 이것은 뷰포트에 비해 너무 큰 하나의 거대한 div로 렌더링됩니다. 다른 div는 전혀 나타나지 않습니다.

저는 약간의 성공을 거둔 유일한 방법과 시도를 조합하여 CSS에서 @media 쿼리를 사용하고 있습니다. 차라리 모든 장치를 지원한다고 보장 할 수는 없기 때문에이 방법을 사용하지 않을 것입니다.

HTML :

<!doctype html> 

<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1, width=device-width, target-densitydpi=device-dpi"> 

    <!-- Latest compiled and minified CSS --> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 
    <link rel="stylesheet" href="main.css"> 
</head> 

<body> 
    <div class="container-fluid" id="app"> 
    <div class="row" id="bg"> 
     <div class="col-md-6 col-lg-6 col-sm-12 col-xs-12" id="pic"> 
     <div class="leftlayer-gradient hidden-md hidden-lg"> 
     </div> 
     </div> 
     <div class="col-md-6 col-lg-6 col-sm-12 col-xs-12" id="details"> 
     <div class="rightlayer"> 
     </div> 
     </div> 
    </div> 
    </div> 

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> 
</body> 
</html> 

CSS :

#pic, #details { 
    height: 100vh; 
} 

#details { 
    background-color: red; 
    -webkit-background-size: 100%; 
    -moz-background-size: 100%; 
    -o-background-size: 100%; 
    background-size: 100%; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 
    background-position: left; 
} 

#pic { 
    background-color: yellow; 
    -webkit-background-size: 100%; 
    -moz-background-size: 100%; 
    -o-background-size: 100%; 
    background-size: 100%; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 
    background-position: right; 
} 

.rightlayer { 
    background-color: rgba(0, 0, 0, 0.5); 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
} 

.leftlayer-gradient { 
    background: -webkit-linear-gradient(top, rgba(0,0,0,0) 70%, rgba(0,0,0,0.5)); /* For Safari 5.1 to 6.0 */ 
    background: -o-linear-gradient(bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.5)); /* For Opera 11.1 to 12.0 */ 
    background: -moz-linear-gradient(bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.5)); /* For Firefox 3.6 to 15 */ 
    background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.5)); /* Standard syntax (must be last) */ 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
} 

답변

0

가 해결 :

문제는 브라우저/OS와 뷰포트 또는 호환성와는 아무 상관 없었다.

나는 내 DNS 공급자로부터 마스킹을 사용하여 전달을 사용하고 있었으며, 그들은 iframe (yuck!)을 통해 사이트로 전달 중이었습니다.

GoDaddy를 사용하는 경우 동일한 문제가있을 수 있습니다.