Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Rounded Edges with Box Shadow – Tailwind CSS

I’m trying to make a slight tweak to my button borders using box shadows but am unsure how.

The following Tailwind.css customization creates the following button border below:

boxShadow: {
  'outline': '3px 3px 0px #777, -3px -3px 0px #777, -3px 3px 0px #777, 3px -3px 0px #777',
}

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

As you can see, it isn’t quite right on the left and right edges, where there’s a slight curl in which they don’t perfectly align. Does anyone know how to fix this so that it’s perfectly round around the entire border?

Thanks in advance.

>Solution :

use spread parameter of box-shadow property

button
{
background:white;
padding:10px 30px;
border-radius:20px;
border:none;
box-shadow:0 0 0 4px rgba(0,0,0,1);
}
<button>Button Test</button>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading