DEV Community

Stephanie Eckles
Stephanie Eckles

Posted on

Quick CSS Tip: Two-toned square join borders

When you define a typical CSS border, the corners join together at a 45-degree angle:

example of normal CSS border join

border-width exaggerated for effect

Instead, we can use a combination of border and box-shadow to produce a square border join:

Open the Codepen to play around with the values, and set $insetBorder to false to place the bottom "border" below the left border.

Top comments (2)

Collapse
 
vaibhavkhulbe profile image
Vaibhav Khulbe

Wow, looks nice. Thanks for sharing!

Collapse
 
marcstigall profile image
Marcus Stigall

Wow this is cool !