W3Schools.com
THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPJQUERYBOOTSTRAPANGULARXML
 

Screen height Property

Screen Object Reference Screen Object

Example

Get the total height of your screen:

var x = "Total Height: " + screen.height;

The result of x will be:


Try it yourself »

More "Try it Yourself" examples below.


Definition and Usage

The height property returns the total height of the user's screen, in pixels.

Tip: Use the width property to get the total width of the user's screen.


Browser Support

Property
height Yes Yes Yes Yes Yes

Syntax

screen.height

Technical Details

Return Value: A Number, representing the total height of the user's screen, in pixels

Examples

More Examples

Example

All screen properties in one example:

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>";

Try it yourself »

Screen Object Reference Screen Object