Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Border declare 4 sides, color, width, in one line

Tags:

css

I have this rule here:

border: 3px 0 0 0 solid #ccc;

Yet, it appears that the 4 sides are of the border are not registering.

border: 3px solid #ccc; 

seems to work fine however.

Is there a way to make a one-liner with 4 side widths assigned?

like image 934
1Up Avatar asked Dec 13 '14 22:12

1Up


2 Answers

Though, there is no exact shorthand for the border, you can still put the width of the border in the same line;

border-width: 1px 0 1px 0;
border-color: red;
border-style: solid;

Hope it helps.

like image 105
Supreet Prakash Avatar answered Oct 26 '22 09:10

Supreet Prakash


If I'm not mistaken, this is the closest you can get to one line:

border: solid #000;
border-width: 0 1px 1px 0;
like image 26
Franc Jerez Avatar answered Oct 26 '22 09:10

Franc Jerez