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

· 19년 전 · 3620
원본 내용

-------------
<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 팁자료실

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

+
제목 글쓴이 날짜 조회
19년 전 조회 8,045
19년 전 조회 2,561
19년 전 조회 5,555
19년 전 조회 1.1만
19년 전 조회 5,642
19년 전 조회 5,245
19년 전 조회 5,073
19년 전 조회 9,013
19년 전 조회 6,131
19년 전 조회 3,621
19년 전 조회 3,591
19년 전 조회 5,643
19년 전 조회 3,454
19년 전 조회 2,594
19년 전 조회 5,048
19년 전 조회 5,111
19년 전 조회 5,583
19년 전 조회 3,823
19년 전 조회 8,114
19년 전 조회 3,635