版权声明:本文为大都督作者的原创文章,未经 大都督 允许也可以转载,但请注明出处,谢谢! 共勉! https://blog.csdn.net/qq_37335220/article/details/86560122
1.效果图
2.HTML代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>72 使用boxModel对象检测是否是W3C盒子模型</title>
<style type="text/css">
body{font-size: 13px;}
div{
margin: 20px;
padding: 10px;
border: solid 1px #666;
background-color: #eee;
width: 300px;
}
</style>
</head>
<body>
<div id="divTip">
</div>
<script src="../jquery.min.js"></script>
<script type="text/javascript">
$(function(){
console.log("support"+$.support)
var strTmp = "您打开的页面是:";
//是W3C盒子模型
if($.support.boxModel) {
strTmp += "W3C盒子模型";
}else {
strTmp += "IE盒子模型";
}
$("#divTip").html(strTmp);
})
</script>
</body>
</html>