专注前端素材!
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>素材8网教程(study.sucai8.cn)</title> </head> <body> <script> if (screen.colorDepth<=8) //为8位屏幕的简单的蓝色背景色 document.body.style.background="#0000FF" else //为现代屏幕的华丽的蓝色背景色 document.body.style.background="#87CEFA" </script> </body> </html>
运行结果