CSS height、clientHeight和offsetHe
2017-07-19 本文已影响111人
YHWXQ简简单单的生活
height:指元素内容的高度,jQuery中的height()方法返回的就是这个高度。
clientHeight:内容高度+padding高度,jQuery中的innerHeight()方法返回的就是这个高度。
offsetHeight:内容高度+padding高度+边框宽度,jQuery中的outerHeight()方法返回的就是这个高度。
width:指元素内容的宽度,jQuery中的width()方法返回的就是这个宽度。
clientWidth:内容高度+padding宽度,jQuery中的innerWidtht()方法返回的就是这个宽度。
offsetWidth:内容高度+padding高度+边框宽度,jQuery中的outerWidth()方法返回的就是这个宽度。
