height

创建于 2024-12-03 / 18
字体: [默认] [大] [更大]

❮ Screen 对象

实例

获取屏幕的总高度:

var x = "Total Height: " + 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>"; 亲自试一试 »
❮ Screen 对象
0 人点赞过