오

브라우저 구별 및 스타일 시트 적용

· 2006-06-26 (월) 15:51:20 · 3840
원본 내용

-------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<title>Browser Hack's for IE (5, 5.5, 6) , FireFox</title>

<style type="text/css">
h1{font:bold 30px verdana;}
p{font:11px/2em verdana;}
#hack{color:red;color/**/:blue;colo\r:purple;}
html>body #hack{color:green;}
</style>
</head>

<body>
<h1 id="hack">브라우져별css적용</h1>

<p>
IE5.0: Red<br>
IE5.5: Blue<br>
IE6.0: Purple<br>
FireFox: Green
</p>
</body>

</html>
-------------

적용 내용
style.css

/*익스플로러*/
body, td, p, button, textarea, select {
color:#blue;

}

/* 파이어 폭스*/
html>body, td, p, button, textarea, select {
color:#red;
}
익스 사용자는 파란색, 파이어폭스는 레드

내용추가

//웹 브라우저 구분
if(eregi("mozilla",$HTTP_USER_AGENT)) {
if(eregi("msie",$HTTP_USER_AGENT)) {
echo "Explorer");
}else{
echo "Netscape";
}

}else{
echo "I donw know!";
}
?>

첨부파일

test.html (478 bytes) 50회 2006-06-26 15:51
|
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
06-07-08 조회 5,639
06-07-08 조회 8,261
06-07-07 조회 2,741
06-07-06 조회 5,793
06-07-05 조회 1.1만
06-07-04 조회 5,866
06-07-04 조회 5,452
06-06-29 조회 5,274
06-06-28 조회 9,252
06-06-27 조회 6,343
06-06-26 조회 3,841
06-06-26 조회 3,774
06-06-26 조회 5,865
06-06-26 조회 3,673
06-06-25 조회 2,768
06-06-23 조회 5,260
06-06-22 조회 5,319
06-06-22 조회 5,760
06-06-21 조회 4,032
06-06-21 조회 8,327