jQuery Dimensions
With jQuery, it is easy to handle the dimensions of elements and browser windows.
jQuery Dimension Methods
jQuery provides several important methods for handling dimensions:
- width()
- height()
- innerWidth()
- innerHeight()
- outerWidth()
- outerHeight()
jQuery Dimensions

jQuery width() and height() Methods
The width() method sets or returns the width of an element (excluding padding, border, or margin).
The height() method sets or returns the height of an element (excluding padding, border, or margin).
The following example returns the width and height of the specified <div> element:
Example
Try it Yourself »
jQuery innerWidth() and innerHeight() Methods
The innerWidth() method returns the width of an element (including padding).
The innerHeight() method returns the height of an element (including padding).
The following example returns the inner-width/height of the specified <div> element:
Example
Try it Yourself »
jQuery outerWidth() and outerHeight() Methods
The outerWidth() method returns the width of an element (including padding and border).
The outerHeight() method returns the height of an element (including padding and border).
The following example returns the outer-width/height of the specified <div> element:
Example
Try it Yourself