代码编辑器:
x
1
<body>
2
<script>
3
if (screen.colorDepth<=8)
4
//为8位屏幕的简单的蓝色背景色
5
document.body.style.background="#0000FF"
6
else
7
//为现代屏幕的华丽的蓝色背景色
8
document.body.style.background="#87CEFA"
9
</script>
10
</body>
11
<body>
<script>
if (screen.colorDepth<=8)
//为8位屏幕的简单的蓝色背景色
document.body.style.background="#0000FF"
else
//为现代屏幕的华丽的蓝色背景色
document.body.style.background="#87CEFA"
</script>
</body>