js中的offsetWidth用法
offsetWidth //返回盒模型的宽度(包括width+左右padding+左右border)
以上div1的offsetWidth为width+2*padding+2*border=200+2*5+2*2=214px
ps:offsetLeft = left+margin-left
offsetTop = top+margin-top
版权声明:本文为xingxyx原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。