前言
最近练习做弹窗,遇到height(),innerHeight(),outerHeight()的区别。
根据下面的盒模型来了解三者的区别。

height():element的height;
innerHeight(): height + padding;


outerHeight(): height + padding +border;
ouerHeight(true): height + padding + border + margin;
注意:.outerHeight is not applicable to window and document objects; for these, use .height() instead.
width(),innerWidth(),outerWidth()同理。
本文详细解析了在前端开发中,元素的height(), innerHeight(), outerHeight()等尺寸属性的区别,通过盒模型概念帮助理解这些属性的具体含义及应用场景。同时,也提到了width(), innerWidth(), outerWidth()的相似概念。
156

被折叠的 条评论
为什么被折叠?



