对clientWidth、offsetWidth、clientHeight、offsetHeigh有时候就是搞不清楚,在网络上找到的别人的总结:
引用内容

IE6.0、FF1.06+:
clientWidth = width + padding
clientHeight = height + padding
offsetWidth = width + padding + border
offsetHeight = height + padding + border
IE5.0/5.5:
clientWidth = width - border
clientHeight = height - border
offsetWidth = width
offsetHeight = height
(CSS中的margin属性,与clientWidth、offsetWidth、clientHeight、offsetHeight均无关)

相关文章:

  • 2021-09-15
  • 2021-07-12
  • 2021-08-29
  • 2021-08-13
  • 2022-02-26
  • 2022-12-23
  • 2021-07-24
猜你喜欢
  • 2021-09-12
  • 2022-01-11
  • 2022-12-23
  • 2021-09-11
  • 2021-08-21
  • 2021-09-13
  • 2021-11-30
相关资源
相似解决方案