2013-07-07 2 views
0

"IE 별도 스타일 시트"와 같은 것이 있지만 많은 예제가 아닌 경우 많은 읽을 거리가 있습니다.IE 조건부 스타일 시트가 작동하지 않습니다.

나는 IE7을 위해 다음과 같은 조건부 CSS를 가지고있다.

나는 margin-top을 IE7에서 더 크게하고 싶습니다. IE의 스타일에서

.outerBlue_s { 
    width: 230px; 
    height: 260px; 
    overflow: hidden; 
    color: #FFF; 
    border-radius: 10px; 
    box-shadow: 5px 5px 2px #cccccc; 
    -moz-box-shadow: 5px 5px 2px #cccccc; 
    -webkit-box-shadow: 5px 5px 2px #cccccc; 
    margin:0 auto; 
    text-align:center; 
    font-size:18px; 
    vertical-align:middle; 

난 단지 원하는 마진 뒀다 :이 작업을 수행에도 불구하고

.outerBlue_s { 
    margin-top:50px; 
} 

을, 여백이 변경되지 않는 내 주요 스타일 시트에서

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" /> 
<!--[if IE 7]> 
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/ie7.css" media="screen" type="text/css" /> 
<![endif]--> 
<!--[if IE 8]> 
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/ie8.css" media="screen" type="text/css" /> 
<![endif]--> 

나는이 있습니다 IE7을 확인할 때.

모든 도움과 조언을 부탁드립니다.

<link rel="stylesheet" type="text/css" media="all" href="http://fafaradesigns.com/wp/wp-content/themes/fafaradesigns/style.css" /> 
<!--[if IE 7]> 
<link rel="stylesheet" href="http://fafaradesigns.com/wp/wp-content/themes/fafaradesigns/ie7.css" media="screen" type="text/css" /> 
<![endif]--> 
<!--[if IE 8]> 
<link rel="stylesheet" href="http://fafaradesigns.com/wp/wp-content/themes/fafaradesigns/ie8.css" media="screen" type="text/css" /> 
<![endif]--> 

ie7 시트가 참조되는 것처럼 보이지 않습니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

나는 각 페이지에 인라인 조건 스타일을 넣어 해킹으로가는 상처 :

<!--[if lt IE 8]> 
<style> 
.innerBlue_c { 
margin-top: 1.5em; 
} 
</style> 

코드가 깨끗했다, 그래서 나는 오히려 외부 별도 즉, 스타일 시트와 함께 갈 것입니다 -하지만 난 할 수 없었다 왜 작동하지 않았는지 알아보십시오. 조건문이 잘못 보입니까?

+1

당신은 소스보기 할 때, 실제 스타일 시트 위치 표시를 위로합니까? 그렇다면 PHP가 아닌 여기에 결과 HTML을 넣을 수 있습니까? –

+0

그리고 나는 특정 브라우저가 다른 브라우저와 다른 여백을 갖길 원한다는 것을 짐작할 수는 없지만, 이유는 분명히 있습니다. –

+0

나는 display : table을 사용하여 수직으로 정렬하기 위해 가로 질러 달린 CSS 트릭을 사용했지만, 불행히도 ie7은 그것을 저해하지 않을 것입니다. 그것이 ie7 여백이 다른 브라우저와 달라지기를 원하는 유일한 이유입니다. –

답변

0

업데이트 : 드디어 Monderizr과 내가 처음에 나열한 조건부 코드를 사용하여로드 할 외부 스타일 시트를 얻었습니다. 외장 시트의 스타일 앞에 .ie7을 추가하면됩니다.

일 코드의 예 :

.ie7 #nav li { 
    z-index: 102; 
} 
관련 문제