代码示例:(标识:eg_js_screen_pixeldepth)
<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = 
"屏幕像素深度是:" + screen.pixelDepth;
</script>

</body>
</html>
运行结果: