--- category: Display created: '2021-05-09' description: Create concave corners with CSS keywords: css border radius, css concave border radius, css concave corners thumbnail: /assets/css-layout/thumbnails/concave-corners.png title: Concave corners --- ## HTML ```html index.html
...
``` ## CSS ```css styles.css .concave-corners { background-color: #d1d5db; /* Used to position the corners */ position: relative; } .concave-corners__corner { /* Absolute position */ position: absolute; /* Size */ height: 1rem; width: 1rem; background: #fff; } .concave-corners__corner--tl { /* Position */ left: 0; top: 0; /* Border radius */ border-radius: 0 0 1rem 0; } .concave-corners__corner--tr { /* Position */ right: 0; top: 0; /* Border radius */ border-radius: 0 0 0 1rem; } .concave-corners__corner--bl { /* Position */ bottom: 0; left: 0; /* Border radius */ border-radius: 0 1rem 0 0; } .concave-corners__corner--br { /* Position */ bottom: 0; right: 0; /* Border radius */ border-radius: 1rem 0 0 0; } ``` ```css styles.css hidden body { height: 24rem; } .concave-corners { background-color: #d1d5db; /* Used to position the corners */ position: relative; /* Misc */ height: 100%; width: 100%; } .concave-corners__corner { /* Absolute position */ position: absolute; /* Size */ height: 1rem; width: 1rem; background: #fff; } .concave-corners__corner--tl { /* Position */ left: 0; top: 0; /* Border radius */ border-radius: 0 0 1rem 0; } .concave-corners__corner--tr { /* Position */ right: 0; top: 0; /* Border radius */ border-radius: 0 0 0 1rem; } .concave-corners__corner--bl { /* Position */ bottom: 0; left: 0; /* Border radius */ border-radius: 0 1rem 0 0; } .concave-corners__corner--br { /* Position */ bottom: 0; right: 0; /* Border radius */ border-radius: 1rem 0 0 0; } ``` ```html index.html hidden
```