screen object
screen
The screen object represents screen information. Commonly used attributes are:
screen.width: screen width, in pixels;
screen.height: Screen height, in pixels;
screen.colorDepth: Returns the number of color digits, such as 8, 16, 24.
<html>
<head>
<script>
'use strict';
alert('Screen size = ' + screen.width + ' x ' + screen.height);
</script>
</head>
<body>
</body>
</html>rrree
new file
<!DOCTYPE html>
<html>
<body>
<h3>Your Screen:</h3>
<script>
document.write("窗口可以使用的屏幕宽高: ");
document.write(window.screen.availWidth + "*" + screen.availHeight);
document.write("<br>");
document.write("屏幕的宽高: ");
document.write(screen.availWidth + "*" + window.screen.height);
document.write("<br>");
document.write("用户浏览器表示的颜色位数: ");
document.write(window.screen.colorDepth);
document.write("<br>");
document.write("用户浏览器表示的颜色位数(ps:IE不支持?亲测好像支持唉): ");
document.write(screen.pixelDepth);
</script>
<body>
</body>
</html>
Preview
Clear
- Course Recommendations
- Courseware download
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning
Let's briefly talk about starting a business in PHP
Quick introduction to web front-end development
Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things
Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]
Login verification and classic message board
Computer network knowledge collection
Quick Start Node.JS Full Version
The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original]
Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance)
















