{{ DomRef() }}
Summary
Returns the layout width of an element.
Syntax
var offsetWidth =element.offsetWidth;
offsetWidth
is a read-only property.
Description
Typically, an element's offsetWidth
is a measurement which includes the element borders, the element horizontal padding, the element vertical scrollbar (if present, if rendered) and the element CSS width.
Example
padding-top
Gentle, individualistic and very loyal, Birman cats fall between Siamese and Persian in character. If you admire cats that are non aggressive, that enjoy being with humans and tend to be on the quiet side, you may well find that Birman cats are just the felines for you.
All Birmans have colorpointed features, dark coloration of the face, ears, legs and tail.
Cat image and text coming from www.best-cat-art.com
padding-bottom
Specification
Specification | Status | Comment |
---|---|---|
{{SpecName('CSSOM View', '#dom-htmlelement-offsetwidth', 'focus')}} | {{Spec2('CSSOM View')}} | |
MSIE's DHTML | Non-Standard | The part of the MSIE's DHTML object model. |
Notes
offsetWidth
is a property of the DHTML object model which was first introduced by MSIE. It is sometimes referred to as an element's physical/graphical dimensions, or an element's border-box width.
References
- {{ MSDN("ms534304", "offsetWidth Property") }}
- {{ MSDN("hh781509", "Measuring Element Dimension and Location") }}
See also
{{ languages( { "fr": "fr/DOM/element.offsetWidth", "pl": "pl/DOM/element.offsetWidth" } ) }}