TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Dual-Track Outline CTA

Two thin outline tracks run in opposite directions to frame a restrained corporate CTA.

Live Demo

Hover over the element or use Tab to focus.

Source Code

Copy the HTML, CSS or JavaScript you need for your project.

HTML
<div class="tbx-1254"><button class="cta" type="button"><span class="rule top"></span><span class="copy">Explore services</span><span class="arr" aria-hidden="true">↗</span><span class="rule bottom"></span></button></div>
CSS
.tbx-1254{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;max-width:100%;min-height:218px;overflow:visible;padding:24px 18px;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#243e43}
.tbx-1254 *,.tbx-1254 *::before,.tbx-1254 *::after{box-sizing:border-box}
.tbx-1254{background:#f8f4ed}
.tbx-1254 .cta{cursor:pointer;border:0;background:transparent;color:#23334d;display:flex;align-items:center;justify-content:space-between;position:relative;width:min(276px,100%);min-height:66px;padding:15px 20px;font-family:inherit}
.tbx-1254 .copy{font-size:18px;font-weight:700;letter-spacing:-.025em}
.tbx-1254 .arr{font-size:24px;transition:transform .4s}
.tbx-1254 .rule{position:absolute;left:0;right:0;height:2px;background:#cdd2d1;overflow:hidden}
.tbx-1254 .top{top:0}
.tbx-1254 .bottom{bottom:0}
.tbx-1254 .rule:after{content:"";display:block;width:100%;height:100%;background:#cc6e45;transform:translateX(-100%);transition:transform .58s cubic-bezier(.22,.8,.2,1)}
.tbx-1254 .bottom:after{transform:translateX(100%);transition-delay:0s}
.tbx-1254 .cta:is(:hover,:focus-visible) .rule:after{transform:none}
.tbx-1254 .cta:is(:hover,:focus-visible) .arr{transform:translate(3px,-4px)}
@media (prefers-reduced-motion: reduce) {.tbx-1254 *, .tbx-1254 *::before, .tbx-1254 *::after { transition-duration:0.01ms !important; animation-duration:0.01ms !important; scroll-behavior:auto !important; } }

How to Use

Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.

Use Case

Useful for calls to action and company websites.

Technical Notes

Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.

Mobile:Ensure the interactive content remains accessible without hover on touch devices.

Browser:Uses modern CSS. Check behavior in the browsers you support.

Reduced Motion:Check that prefers-reduced-motion is respected.