Home > OS >  problem while using border shorthand property
problem while using border shorthand property

Time:11-05

I'm using the following border shorthand property (border: 10px 2px 3px 4px solid black;) why does it not work.

I tried (border: 10px 2px 3px 4px solid black;) using border shorthand property, and in browser it is not showing up any border to my element

CodePudding user response:

According to MDN docs: !(https://developer.mozilla.org/en-US/docs/Web/CSS/border), the shorthand property you trying to apply should be like so: border: 1px solid black; since you are trying to use border as padding|margin shorthand property it will not work.

border shorthand property consists off:

border: <border-width> <border-style> <border-color>

instead you can try this:

border: solid black;
border-width: 10px 2px 3px 4px;
  • Related