Which of the two methods conforms to W3C standards? Do they both behave as expected across browsers?
border: none;
border: 0;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both are valid. It’s your choice.
I prefer
border:0because it’s shorter; I find that easier to read. You may findnonemore legible. We live in a world of very capable CSS post-processors so I’d recommend you use whatever you prefer and then run it through a "compressor". There’s no holy war worth fighting here but Webpack → LESS → PostCSS → PurgeCSS is a good 2020 stack.That all said, if you’re hand-writing all your production CSS, I maintain —despite the grumbling in the comments— it does not hurt to be bandwidth conscious. Using
border:0will save an infinitesimal amount of bandwidth on its own, but if you make every byte count, you will make your website faster.The CSS2 specs are here. These are extended in CSS3 but not in any way relevant to this.
You can use any combination of width, style and colour.
Here,
0sets the width,nonethe style. They have the same rendering result: nothing is shown.