Corner bracket heading
Corner bracket heading in CSS: four hairline brackets drawn with background gradients that stretch on hover. No extra elements.
The brackets are not borders or pseudo-elements. The wrapper stacks eight single-color linear-gradient backgrounds, a 12px by 1px line and a 1px by 12px line for each corner, set to no-repeat and pinned with background-position. On hover, background-size changes to 28px and a transition on background-size makes the brackets stretch. The heading is plain text with tight letter-spacing and text-wrap: balance, so you can change it without touching the brackets.
snippet.html36 lines
<div class="cbh">
<h2 class="cbh__text">We Picked The Narrow Path On Purpose</h2>
<p class="cbh__note">*Measured on our own support queue <a href="#">(Method)</a></p>
</div>
<style>
.cbh {
--cbh-ink: #3a3a3a;
--cbh-bg: #f386a1;
box-sizing: border-box;
position: relative;
width: min(100%, 760px);
padding: 40px 28px 28px;
background: var(--cbh-bg);
color: var(--cbh-ink);
font-family: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
text-align: center;
background-image:
linear-gradient(var(--cbh-ink), var(--cbh-ink)), linear-gradient(var(--cbh-ink), var(--cbh-ink)),
linear-gradient(var(--cbh-ink), var(--cbh-ink)), linear-gradient(var(--cbh-ink), var(--cbh-ink)),
linear-gradient(var(--cbh-ink), var(--cbh-ink)), linear-gradient(var(--cbh-ink), var(--cbh-ink)),
linear-gradient(var(--cbh-ink), var(--cbh-ink)), linear-gradient(var(--cbh-ink), var(--cbh-ink));
background-repeat: no-repeat;
background-size: 12px 1px, 1px 12px, 12px 1px, 1px 12px, 12px 1px, 1px 12px, 12px 1px, 1px 12px;
background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%;
transition: background-size 0.25s ease;
}
.cbh:hover {
background-size: 28px 1px, 1px 28px, 28px 1px, 1px 28px, 28px 1px, 1px 28px, 28px 1px, 1px 28px;
}
.cbh__text { margin: 0; font-size: clamp(32px, 7vw, 76px); font-weight: 600; line-height: 0.88; letter-spacing: -0.055em; text-wrap: balance; }
.cbh__note { margin: 28px 0 0; text-align: left; font: 12px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.06em; text-transform: uppercase; }
.cbh__note a { color: inherit; }
.cbh__note a:focus-visible { outline: 2px solid var(--cbh-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cbh { transition: none; } }
</style>