Home Ads

[HTML] 조건 주석문 처리방식

if IE 사용 방법
 <!--[if !IE]> <![endif]--> 
 ie브라우저가 아닐 경우
 <!--[if IE]> <![endif]-->
 ie브라우저일 경우
 <!--[if IE 8]> <![endif]--> 
 ie8 브라우저
 <!--[if IE 7]> <![endif]--> 
 ie7 브라우저
 <!--[if IE 6]> <![endif]-->
 ie6 브라우저
 <!--[if lt IE 8]> <![endif]-->
 ie8미만 브라우저
 <!--[if lte IE 8]> <![endif]-->
 ie8이하 브라우저  (e가 있으면 포함)
 <!--[if gt IE 8]> <![endif]-->
 ie8초과 브라우저 
 <!--[if gte IE 8]> <![endif]-->
 ie8이상 브라우저  (e가 있으면 포함)
 [if (gt ie 6)&(lt ie 9)]
 ie 6 이후버전이고 ie 9 이전버전 이라면
 [if (ie 6)|(ie 8)] 
 ie 6 이거나 ie 8 이라면
 [If !(ie 8)] 
 ie 8 이 아니라면


IE 전용 조건주석문의 두가지 사용법
<!--[if gt IE 8]><!--><link rel="stylesheet" type="text/css" href="/common/css/style.css">
<!--<![endif]-->
<!--[If IE 6]><link rel="stylesheet" type="text/css" href="/common/css/store-locator.css"><![endif]-->

<!-- // ie전용 조건 주석문에는 !가 있지만 없다면 다른 브라우저까지 포함을 의미 --><!--[if gt IE 8]>-->  <link rel="stylesheet" type="text/css" href="/common/next/css/pages/store-locator.css">
<!--<![endif]-->



if gt ie 8 or not ie (ie 9이상이고 ie가 아닌 브라우저들 표현 방법)

<!--[if !ie]>--><link href="non-ie.css" rel="stylesheet">
<!--<![endif]-->



해당 클래스를 버전별로 사용하기
<!--[if IE 7] 표현식을 사용할 때는 띄어쓰기 공백을 주의해야 한다. -- 다음에 공백이 존재해서는 안된다.

<!--[if IE 7]><![endif]--><!--[if IE 8]><![endif]--><!--[if IE 9]><![endif]--><!--[if gt IE 9]><!--><!--<![endif]-->

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]--><!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]--><!--[if gt IE 8]><!--> <html lang="ko-KR" class="no-js"> <!--<![endif]-->





출처: http://webclub.tistory.com/17 [Web Club]
[HTML] 조건 주석문 처리방식 [HTML] 조건 주석문 처리방식 Reviewed by 코알라 on 9월 20, 2018 Rating: 5

댓글 없음:

페이지

Powered by Blogger.