What is the correct way to remove the border with CSS?

4

To remove borders in CSS I usually use one of two values:

.exemplo{
    border:0;
    /* ou */
    border:none;
}

The funny thing is that both work, and this happens with other properties like outline , but which of the two properties would be the correct to use in this case? Or is there a "correct" (semantically speaking) or does it make no difference?

    
asked by anonymous 09.06.2014 / 19:52

3 answers

5

See section 8.5.3 of this W3C page available at this link:

link

According to the same none is the property that defines that the element will have no border and will be computed with 0.

Both are correct, but if you want to have no borders use 'none' that best demonstrates your (semantic) code intentions.

    
09.06.2014 / 20:00
2

The two are correct, if you set 0 or none of the same.

    
09.06.2014 / 20:00
2

Either one is fine.

According to the specifications , you use a or the other.

Value:      [ <border-width> || <border-style> || <'border-top-color'> ] | inherit

Size: 0 or Style: none , both are considered correct and can be used alone

Unless you're worried about the size of the css and consequently the performance, then it ends up paying more (for little, very little, almost nothing) use the 0, although the difference do not get noticed anytime soon.

    
09.06.2014 / 19:57