jQuery get the rendered height of an element?

Try one of: var h = document.getElementById(‘someDiv’).clientHeight; var h = document.getElementById(‘someDiv’).offsetHeight; var h = document.getElementById(‘someDiv’).scrollHeight; clientHeight includes the height and vertical padding. offsetHeight includes the height, vertical padding, and vertical borders. scrollHeight includes the height of the contained document (would be greater than just height in case of scrolling), vertical padding, and vertical borders.

Canvas is stretched when using CSS but normal with “width” / “height” properties

It seems that the width and height attributes determine the width or height of the canvas’s coordinate system, whereas the CSS properties just determine the size of the box in which it will be shown. This is explained in the HTML specification: The canvas element has two attributes to control the size of the element’s … Read more

Percentage Height HTML 5/CSS

I am trying to set a div to a certain percentage height in CSS Percentage of what? To set a percentage height, its parent element(*) must have an explicit height. This is fairly self-evident, in that if you leave height as auto, the block will take the height of its content… but if the content … Read more