CSS border shorthand when each border has a different width
Asked Answered
B

1

20

Hi,

what is the shorthand for border when borders have different width?

I tried this:

border:1px solid black, 2px solid black, 3px solid black, 4px solid black;

and this:

 border:1px 2px 3px 4px, solid, solid, solid, solid, black, black, black, black;

but none of them work.

Thank you.

Bans answered 25/5, 2016 at 12:27 Comment(0)
M
33

Use

border: solid black;
border-width: 1px 2px 3px 4px;
Messily answered 25/5, 2016 at 12:34 Comment(2)
I see. I thought there was a one-line shorthand for that. Thank you.Bans
border: solid black; should be written before border-width: 1px 2px 3px 4px; otherwise it is not going to work (so you cannot sort the css lines alphabetically).Murdoch

© 2022 - 2024 — McMap. All rights reserved.