Dimensions
Done with the previous section? Good, now it's time for the methods that work with element dimensions.
returns the element's height excluding padding and borders;
if there are multiple elements in the selection, the first one is returned;
unlike the css("height") method, the value is returned without units
sets the height of all elements in the selection;
if the height value is passed without units, it will be in pixels px
The width() and width(width) methods behave the same as height(), but work with the element's width:
returns the element's width excluding padding and borders; if there are multiple elements in the selection, the first one is returned; the value is returned without units
sets the width of all elements in the selection;
if the width value is passed without units, it will be in pixels px
return the element's height and width respectively, including padding
return the element's height and width, including padding and border
return the element's height and width, including padding, border, and margin
To illustrate the differences between height(), innerHeight(), and outerHeight(), I created the following example:
In this example, the central element with id=block has the following styles:
Now let's see what each of these functions returns:
To make it easier to understand what's going on, I went the extra mile and combined several images from the official documentation into one full illustration:

Last updated