Screen height 属性
页面下方有更多实例。
定义和用法
height 属性返回用户屏幕的总高度(以像素为单位)。
提示: 使用 width 属性获取用户屏幕的总宽度。
浏览器支持
属性 | |||||
---|---|---|---|---|---|
height | Yes | Yes | Yes | Yes | Yes |
语法
screen.height
技术细节
返回值: | 数值,表示用户屏幕的总高度,以像素为单位 |
---|
更多实例
实例
所有屏幕属性:
var txt = "";
txt += "<p>Total width/height: " + screen.width + "*" + screen.height + "</p>";
txt += "<p>Available width/height: " + screen.availWidth + "*" + screen.availHeight + "</p>";
txt += "<p>Color depth: " + screen.colorDepth + "</p>";
txt += "<p>Color resolution: " + screen.pixelDepth + "</p>";
亲自试一试 »
txt += "<p>Total width/height: " + screen.width + "*" + screen.height + "</p>";
txt += "<p>Available width/height: " + screen.availWidth + "*" + screen.availHeight + "</p>";
txt += "<p>Color depth: " + screen.colorDepth + "</p>";
txt += "<p>Color resolution: " + screen.pixelDepth + "</p>";
❮ Screen 对象