对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均无关)