Screen width Property

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP







<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->



Screen width Property


❮ Screen Object




Example


Get the total width of your screen:



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

<!--

The result of x will be:





document.write("Total Width: " + screen.width);
-->
Try it Yourself »

More "Try it Yourself" examples below.



Definition and Usage


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


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



Browser Support














Property
width Yes Yes Yes Yes Yes

Syntax



screen.width

Technical Details




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

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

Popular posts from this blog

PHP code is not being executed, instead code shows on the page

Administrative divisions of China

Cardinality of the set of algorithms