<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>screen</title>
</head>
<body>
<script>
//window.screen屏幕的宽高,window可以省略
document.write('屏幕宽度是:'+screen.width);
document.write('屏幕高度是:'+screen.height);
//availHeight 比如减去任务栏
document.write('屏幕可以使用宽度是:'+screen.availWidth);
document.write('屏幕可以使用高度是:'+screen.availHeight);
</script>
</body>
</html>