html/html_css

★★크로스브라우징 메모★★

갓리버리 2014. 1. 21. 14:27


익스플로러_호환.html


★조건주석문(conditinal comment)★

if를 이용해 주석문처럼 사용하며 css유효성검사를 통과할수 있음 익스플로러 몇까지 적용될수 있는지는 모름

 

주의사항: 스타일안에 적용 안됨

 

ex)

<!--[if IE 7]>
<p>브라우저를 업데이트하여 주십시오.</p>
<![endif]-->

 

<!--[if IE 7]>

<p>브라우저를 업데이트하여 주십시오.</p>

<![endif]-->

 

 

<!--[if IE 6]>

<link rel="stylesheet" type="text/css" href="css/ie6.css">

<![endif]-->

 

 

★html5 태그를 지원하지 않는 IE9 이하 브라우저에서만 아래와 같은 js를 사용합니다.

<!--[if lt IE 9]>

    <script type="text/javas-ript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

 

https://code.google.com/p/html5shiv/

 

※ ie6에서 ie7이상의 css 소스를 사용하려면 구글에서 제공하는 js파일을 임폴트할수있다.

 

<!--[if IE 6]>

<script src="http://ie7-js.googlecode.com/svn/version/2.1"(beta4)/IE9.js"></script>

<![endif]-->

 

-------------------------------------------------------

 

 

 

※조건주석문을 제외한 아래 핵들은 css유효성검사를 통과하기 힘들다고함(그게뭐지)

 

*html필터*

 

선택자앞에 *html을 붙이면 익스플로러 4~6사이에만 스타일이 적용됨

ex) *html p {color:red;}

 

 

언더스코어 핵(underscore hack)

언더스코어(_)를 붙여서 html필터같이 해결 익스플로러6에만 적용됨

ex) p {_color:red }

 

해시핵(hash hack)

위와같이 #을 붙여주면 익스플로러4~7까지만 적용됨

ex) p {#color:red }

 

 

IE7 전용핵
셀렉트 앞에 *:first-child+html 를 붙히며, IE 7에만 적용이 됩니다.

ex) *:first-child+html p { padding:3px; }

 

 

사파리전용핵

body:first-of-type
ex) body:first-of-type #wrap

 

파이어폭스에서 익스플로어 코딩맞추기

width="300" wid/th="300" //익스플로러에서 넓이 맞추기

 

 

기타 고전핵 관련 링크

http://www.miso2ro.com/hometip/22263

 

---------------------------------------------------------