• Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • 参考手册
    • 概述 / Web 技术

      适用于开发者的 Web 技术参考手册

    • HTML

      Web 内容的结构

    • CSS

      用于描述文档样式的代码

    • JavaScript

      通用脚本语言

  • 开发指南
    • 概述 / MDN 学习区

      学习 Web 开发

    • MDN 学习区

      学习 Web 开发

    • HTML

      学习使用 HTML 构建 Web 内容

    • CSS

      学习使用 CSS 设置内容样式

    • JavaScript

      学习在浏览器中运行脚本

  • 更多中文网
  1. 面向开发者的 Web 技术
  2. 网络 API
  3. Screen
  4. availWidth

目录

  • Value
  • Examples
  • Specifications
  • Browser compatibility
  1. Screen
  2. Instance properties
    1. availHeight
    2. availWidth
    3. colorDepth
    4. height
    5. isExtended Experimental
    6. mozBrightness Non-standard Deprecated
    7. mozEnabled Non-standard Deprecated
    8. orientation
    9. pixelDepth
    10. width
  3. Instance methods
    1. lockOrientation() Deprecated
    2. unlockOrientation() Deprecated
  4. Events
    1. change Experimental
    2. orientationchange Non-standard Deprecated

目录

  • Value
  • Examples
  • Specifications
  • Browser compatibility

Screen: availWidth property

The Screen.availWidth property returns the amount of horizontal space (in pixels) available to the window.

Value

A number.

Examples

js
const screenAvailWidth = window.screen.availWidth;

console.log(screenAvailWidth);

Specifications

Specification
CSSOM View Module
# dom-screen-availwidth

Browser compatibility

BCD tables only load in the browser

MDN Web 中文网 - 粤ICP备13048890号