2014-04-15 2 views
0
<link rel="stylesheet" media="screen and (min-width: 20px) and (max-width: 375px) and (orientation:portrait)" href="css/detailsLayout280.css" /> 
<link rel="stylesheet" media="screen and (min-width: 20px) and (max-width: 375px) and (orientation:portrait)" href="css/copy280.css" /> 
<link rel="stylesheet" media="screen and (min-width: 376px) and (max-width: 700px) and (orientation:landscape)" href="css/detailsLayout320.css" /> 
<link rel="stylesheet" media="screen and (min-width: 376px) and (max-width: 700px) and (orientation:landscape)" href="css/copy320.css" /> 

CSS가 처음 iPhone에로드되지 않는 페이지가 있는데, 앞뒤로 방향을 전환하면됩니다.CSS가 iPhone에로드되지 않습니다. 새로 고침

새로 고침을 클릭하면 방향 변경을 다시 수행 할 때까지 CSS가 다시로드되지 않습니다.

보조 페이지에서만 발생합니다. 홈 페이지는 거의 동일한 방식으로 설정되며 정상적으로 작동합니다.

나는이있다 : 나는 아이 패드 CSS에 필요한

<meta name="viewport" content="width=device-width, initial-scale=1"> 

합니다. 이 문제를 해결하면 문제는 전화를 통해 없어지지만 (축소 된 상태 임에도 불구하고) iPad 용으로 필요합니다.

방향을 변경하지 않으면 왜 CSS가로드되지 않습니까?

감사합니다.

답변

0

스마트 폰의 너비가 700px 이상이므로 픽셀 밀도를 지정해야 할 수도 있습니다.

브라우저 특정

(-moz-min-device-pixel-ratio: 2) 
(-o-min-device-pixel-ratio: 2/1) 
(-webkit-min-device-pixel-ratio: 2) 
(min-device-pixel-ratio: 2) 

당신이 개발을 다음 HREF 경로를 변경 자주 CSS를 변경하는 경우는 물음표가 포함되어 있으므로이

<link rel="stylesheet" media="screen and (min-width: 20px) and (max-width: 375px) and (orientation:portrait) and (-webkit-min-device-pixel-ratio: 2)" href="css/detailsLayout280.css" /> 
0

을 적용 할 수있는 방법에 대한 간단한 예제 및 그곳에서 뭔가가 변했습니다. php를 사용하는 예는 다음과 같습니다 :

<link rel="stylesheet" type="text/css" href="style.css?<?php echo date('l jS \of F Y h:i:s A'); ?>" /> 

이 방법은 모든 시간은 href 다를 수 있습니다. 그러나 브라우저의 캐싱 기능을 사용하지 못하므로 프로덕션에서는 좋지 않습니다. 프로덕션에서는 css 파일의 파일 이름이 버전인지 확인하십시오.

+0

그가 PHP를 어떻게 사용하고 있는지 어떻게 알 수 있습니까? – MiniRagnarok

+0

@MiniRagnarok - 좋은 지적. 편집 중. – Grzegorz

+0

나는 뭔가를 놓친다 고 생각했다. :) – MiniRagnarok

관련 문제