Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable border (border: 0 none)

Tags:

css

border

I've always used the notation border: 0 none, presumably that means border-width: 0 and border-style: none.

Does anybody else use write it this way? Is it really necessary to declare both style and width for safe removal?

like image 691
aprestmo Avatar asked Oct 23 '25 13:10

aprestmo


1 Answers

border:none; should achieve the same effect according to the spec.

The border property can be set with the following values:

<line-width> || <line-style> || <color>

When one of these values is omitted its value is set to its initial value. So border:none; will actually have the initial line-width value added:

border: medium none;

However, the line-style value of none will cause the color and width values to be ignored as stated in the CSS Specification:

‘none’ No border. Color and width are ignored (i.e., the border has width 0).

like image 171
Kevin Bowersox Avatar answered Oct 27 '25 05:10

Kevin Bowersox