1. What is the difference between border:none and border:0?
First the performance difference :
- {border: 0;}: Set the border to 0 pixels, although it cannot be seen on the page, but press border
默认值理解
, the browser still performs border-width/border-color渲染
, that is, it has been占用内存值
; - {border:none;} is understood as border-style:none. border:0; than border:none
多渲染了一个border-width:0
, which is why border:none性能
is better than border:0高
;
Compatibility differences :
{border:none;} When the border is "none", it seems to be invalid for IE6/7, and the border still exists. When the border is "0", all browsers hide the border consistently.