[Front-end learning-CSS (21) border:none and border:0]

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.


 

Guess you like

Origin blog.csdn.net/weixin_60364883/article/details/123055332