X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Screen width Property

Screen Object Reference Screen Object

Example

Return the total width of your screen:

var x = "Total Width: " + screen.width;

The result of x will be:


Try it yourself »


Definition and Usage

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


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The width property is supported in all major browsers.


Syntax

screen.width

Return Value

Type Description
Number The total width of the user's screen, in pixels


Examples

More Examples

All screen properties in one example


Screen Object Reference Screen Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook