Element Styles

Getting and setting element styles, dimensions and positions.


Set and get CSS styles of elements

Get the computed style properties or set CSS properties for an element.

jQuery: $.css()

Get and set scroll position of an element

Get or set the horizontal and vertical scroll position of an element or the document.

jQuery: $.scrollLeft(), $.scrollTop()

Get the offset position of an element relative to its parent

Get the top/left coordinates of an element relative to the offset parent.

jQuery: $.position()

Get the position of an element relative to the document

Get the current top/left coordinates of an element relative to the document.

jQuery: $.offset()

Getting width and height of an element

Get the current computed dimension of an element, with or without borders and margins

jQuery: $.width(), $.height(), $.outerWidth(), $.outerHeight(), $.innerWidth(), $.innerHeight()