The difference between Border:none and border:0;

Source: Internet
Author: User

Core Tip: This problem in the network believe that many people have asked, and recently been held up for discussion, to record a personal understanding, border:none; with border:0, there are two points: first, the theoretical performance difference is the difference between browser compatibility.

This problem in the network believe that many people have asked, and recently was held up for discussion, to record the personal understanding of the border:none; with border:0, there are two points: one is the theoretical performance difference two is browser compatibility difference.

1. Performance Difference


"BORDER:0;" Border set to "0" pixel although not visible on the page, but by the border default value, the browser still renders Border-width/border-color, that is, the memory value has been consumed.


"Border:none" border set to "None" is not, the browser resolves "none" will not render action, that is, does not consume memory values.

2. Compatibility difference


Compatibility differences are only for browsers IE6, IE7 and label button, input, this situation can occur under win, Win7, Vista XP themes.

"Border:none;" When Border is "none" it appears that the IE6/7 invalid border still exists, as in the following example

"border:0;" when Border is "0", the feeling is more efficient than "none", all browsers are consistent to hide the border


Summarize:


1. The difference between border:0 and Border:none is that they are rendered and not rendered, feel them and display:none, similar to the Visibility:hidden; And for the border properties of the rendering performance comparison temporarily did not find a test method, although they believe that there are differences in rendering performance but also can only be said theoretically.

2. How to make border:none; achieve full compatibility? Just add background properties to the same selector


for border:0 and Border:none; Individuals are more used, border:none, because Border:none; after all, there is no dispute over performance consumption, and compatibility can be overcome by background attributes that are not sufficient to become an obstacle.



Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.