What size is your viewport width?

Your browser does not support CSS media queries.

Your browser does not support resize events.


Select the correct answer:

  • window.innerWidth;
  • documentElement.clientWidth;
  • $(window).width();

Try viewing the page in different browsers to see how each handles viewport size. Specifically, try it out in Internet Explorer 9, Firefox, Chrome for Windows, Safari for Windows, and Opera.

Toggle Scroll Bars

Get the correct value using JavaScript

Learn more about the CSS viewport and download the script to properly detect it.

var width = viewportSize.getWidth();

By @tysonmatanich