Get the width and height of the div block in jquery

https://blog.csdn.net/ll641058431/article/details/52768825

 

get width

$('div').width(); Get: the width of the block itself

$('div').outerWidth(); Get: block width + padding width + border width

$('div').outerWidth(true); Get: block width + padding width + border width + margin width

 

get height

$('div').height(); Get: the height of the block itself

$('div').outerHeight(); Get: block height + padding height + border height

$('div').outerHeight(true); Get: block height + padding height + border height + margin height

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324665802&siteId=291194637