专题文章
时长:00:00更新时间:2020-11-27 20:22:38
offsetWidth表示对象的可见宽度。比如。#p1 { width: 100px;height: 200px;background: red;}。结果:100;#p1 { width: 100px;height: 200px;background: red;border: 2px solid black;}。结果:104 (100 + 2 + 2)。#p1 { width: 100px;height: 200px;background: red;border: 2px solid black;padding: 20px;}。结果:144 (100 + 2 + 2 + 20 + 20)。
查看详情