Difference between scrollHeight, offsetHeight, and clientHeight. Box model in CSS | Saatody | Amit Padhiyar
scrollHeight
scrollHeight is a measurement of the height of an element's content including content not visible on the screen due to overflow.
offsetHeight
offsetHeight is a measurement which includes the element borders, the element vertical padding, the element horizontal scrollbar (if present, if rendered) and the element CSS height.
clientHeight
It returns the inner height of an element in pixels, including padding but not the horizontal scrollbar height, border, or margin.
For more information see answer of StackOverflow and for Box model checkout mozilla answer.
Comments
Post a Comment