You can get the horizontal size of a specific element by query width, innerWidth, outerWidth. width - padding inside size innerWidth - border inside size outerWidth - border size including The following is an example of adding padding and margin to see how each value changes. border 1px, width 500px border 1px, width 500px, padding 10px border 1px, width 500px, padding 10px, margin 10px