브라우저 구별 및 스타일 시트 적용
원본 내용
-------------
<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!";
}
?>
-------------
<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!";
}
?>
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 9 | 20년 전 | 8013 | ||
| 8 | 20년 전 | 5881 | ||
| 7 | 20년 전 | 6333 | ||
| 6 | 20년 전 | 10667 | ||
| 5 | 20년 전 | 6299 | ||
| 4 | 20년 전 | 7726 | ||
| 3 | 20년 전 | 7460 | ||
| 2 | 20년 전 | 8824 | ||
| 1 | 20년 전 | 7950 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기