Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS border shorthand when each border has a different width

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.

like image 928
Cain Nuke Avatar asked May 25 '16 12:05

Cain Nuke


People also ask

Which is the correct for applying shorthand border property?

CSS Shorthand Border Property To shorten the code, it is also possible to specify all the individual border properties in one property. The border property is a shorthand property for the following individual border properties: border-width. border-style (required)

Can you have 2 borders CSS?

Introduction to CSS Multiple Borders. Multiple borders in CSS can be done by box-shadow property. Generally, we can get a single border with border property. Box-shadow property is not for multiple borders, but still, we are creating multiple borders with box-shadow property.

How many parameters does the Border property shorthand normally have?

There are mainly three border properties: The border-style :- Specifies whether a border should be solid, dashed line, double line, or one of the other possible values. The border-color :- Specifies the color of a border. The border-width :- Specifies the width of a border.


1 Answers

Use

border: solid black;
border-width: 1px 2px 3px 4px;
like image 50
Syed Talha Hai Avatar answered Sep 19 '22 15:09

Syed Talha Hai