CSS Text Link Button
A minimal tertiary button styled like a link, with an underline that tightens and an arrow that nudges.
<button class="btn-text">View all projects <span aria-hidden="true">→</span></button>
.btn-text {
padding: 6px 2px;
border: 0;
background: none;
color: #4338ca;
font: 600 16px/1.3 system-ui, sans-serif;
text-decoration: underline;
text-decoration-color: #c7d2fe;
text-decoration-thickness: 2px;
text-underline-offset: 6px;
cursor: pointer;
transition: text-decoration-color 0.2s ease, text-underline-offset 0.2s ease;
}
.btn-text span {
display: inline-block;
transition: transform 0.2s ease;
}
.btn-text:hover {
text-decoration-color: currentColor;
text-underline-offset: 3px;
}
.btn-text:hover span {
transform: translateX(4px);
}
.btn-text:focus-visible {
border-radius: 4px;
outline: 2px solid #4338ca;
outline-offset: 2px;
}
About this CSS Text Link Button
This CSS Text Link Button is 33 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms and keyboard focus styles. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#4338ca#c7d2fe
How to use this text link button
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.btn-textclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.