Window Screen


The window.screen object provides information about the user's screen or monitor. It represents the screen on which the browser window is being displayed. Here are some commonly used properties of the window.screen object:

screen.width

Returns the width of the screen in pixels.

Example

Preview

screen.height

Returns the height of the screen in pixels.

Example

Preview

screen.availWidth

Returns the available width of the screen, excluding operating system interface elements like the taskbar, in pixels.

Example

Preview

screen.availHeight

Returns the available height of the screen, excluding operating system interface elements like the taskbar, in pixels.

Example

Preview

screen.colorDepth

Returns the bit depth of the color palette for displaying images on the screen. This represents the number of bits used to represent each color component.

Example

Preview

screen.pixelDepth

Returns the pixel depth of the screen. This represents the number of bits used to represent each pixel.

Example

Preview

By accessing these properties, you can gather information about the user's screen size, available screen space, and color capabilities. This information can be useful when developing responsive web applications or when you need to adapt the content based on the user's screen resolution.