I believe this question has been asked by many people on the Internet, and it has been discussed again recently. I would like to record my personal understanding. The difference between border:none; and border:0; is reflected in two points: First, the theoretical performance The second difference is the difference in browser compatibility.
Performance differences:
[border:0;] Although the pixels set to "0" for the border are not visible on the page, according to the default value of the border, the browser still renders the border-width/border-color, that is, the memory value has been occupied.
[border:none;] Set the border to "none", which means there is no border. When the browser parses "none", it will not perform rendering actions, that is, it will not consume memory values.
Compatibility differences:
The compatibility difference only applies to browsers IE6, IE7 and label buttons and inputs. This situation will occur under the XP theme of win, win7, and vista.
[border:none;] When border is "none", it seems that the invalid border for IE6/7 still exists, as shown in the following example Demo1 :
[border:0;] When border is "0", it feels more effective than "none". All browsers hide the border uniformly, as shown in the following example Demo2 :
Summarize :
Comparing border:0; and border:none;, the difference lies in rendering and no rendering. I feel that they have a similar relationship with display:none; and visibility:hidden;. However, there is no test for the rendering performance comparison of the border attribute. Method, although it is believed that there is a difference in rendering performance, it can only be said to be theoretical.
How to make border:none; fully compatible? Just add the background attribute to the same selector, as shown in the following example Demo3 :
Regarding border:0; and border:none;, I personally prefer to use border:none;, because border:none; is not controversial in terms of performance consumption after all, and compatibility can be solved with background attributes and is not an obstacle.