以前的 IE 认为 style 的 width 是包含 border 的,Firefox 认为 width 是不包含 border 的。但对图片的解释又怎样呢?
<img src="http://www.itpow.com/images/cftea.gif" border="20">
<img src="http://www.itpow.com/images/cftea.gif" style="border:20px solid red;width:135px;">
<img src="http://www.itpow.com/images/cftea.gif" style="border:20px solid red;">
以上三段代码,它的效果都是类似于如下的:
也就是说,无论是哪个浏览器,在对待图片边框时,都认为它是独立在 width 之外的。