第一种CSS方式判断
<html>
<head>
<title>判断IE版本并给出提示升级浏览器</title>
</head>
<style type="text/css">
#ie6-warning{
background:rgb(255,255,225) url("图片地址") no-repeat scroll 3px center;
position:absolute;
top:0;
left:0;
font-size:12px;
color:#333;
width:97%;
padding: 2px 15px 2px 23px;
text-align:left;
}
#ie6-warning a {
text-decoration:none;
}
</style>
<body>
<br /><br />
<!--[if lte IE 6]>
<div id="ie6-warning">您正在使用 Internet Explorer 6,在本页面的显示效果可能有差
异。建议您升级到 <a href="http://www.microsoft.com/china/windows/internet-
explorer/" target="_blank">Internet Explorer 8</a> 或以下浏览器: <a
href="http://www.mozillaonline.com/">Firefox</a> / <a
href="http://www.google.com/chrome/?hl=zh-CN">Chrome</a> / <a
href="http://www.apple.com.cn/safari/">Safari</a> / <a
href="http://www.operachina.com/">Opera</a>
</div>
<![endif]-->
</body>
</html>
jQuery(function () {
var isIE = !!window.ActiveXObject;
var isIE6 = isIE && !window.XMLHttpRequest;
if (isIE) {
if (isIE6) {
alert('您的浏览器版本为IE6,为保证您浏览网页效果,请您先升级您的浏览器版本.');
}
});