A horizontal Curly Bracket

Had a contest with someone at work the other day to do a strictly old CSS implementation of a horizontal curly bracket. Of course, now I’d probably look at writing a } character and rotating it, or just writing out an SVG, but this was a lot of fun.

Here’s a JS Fiddle. Of course, I can only promise it works in Chrome 41 on my Mac.

.item {
width: 200px;
}
.top {
margin-bottom: -8px;
text-align: center;
}
.borders {
border-bottom: black solid 1px;
border-left: black solid 1px;
border-right: black solid 1px;
height: 8px;
border-bottom-right-radius:8px;
border-bottom-left-radius:8px;
}
.leftcurve {
height:5px;
width: 5px;
border-top:black solid 1px;
border-right: black solid 1px;
border-top-right-radius: 5px;
display: inline-block;
}
.rightcurve {
height: 5px;
width: 5px;
border-top: black solid 1px;
border-left: black solid 1px;
border-top-left-radius: 5px;
display: inline-block;
margin-left: -4px;
}
.arrow {
background-color: white;
top: -7px;
left: 50px;
width:12px;
position: relative;
z-index:50;
}
view raw brace.css hosted with ❤ by GitHub
<div class="item">
<div class="top">Button Text</div>
<div class="borders"></div>
<div class="arrow">
<div class="leftcurve"></div>
<div class="rightcurve"></div>
</div>
</div>
view raw brace.html hosted with ❤ by GitHub
©2022 Kyle Schmidt some rights reserved