TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Chevron Curtain Action

Chevron-shaped curtains separate to emphasize the call-to-action label.

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
<button class="tbx-1277" type="button"><span class="tbx-1277__left" aria-hidden="true">❮</span><span class="tbx-1277__label">View services</span><span class="tbx-1277__right" aria-hidden="true">❯</span></button>
CSS
.tbx-1277{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;position:relative;isolation:isolate;gap:12px;min-width:224px;max-width:100%;padding:18px 24px;border:1px solid #254e65;border-radius:4px;background:#f7fcff;color:#173e54;font:700 15px/1.4 system-ui,sans-serif;letter-spacing:.03em;cursor:pointer;overflow:hidden;transition:color .4s,box-shadow .4s}
.tbx-1277::before,.tbx-1277::after{content:"";position:absolute;z-index:-1;top:0;bottom:0;width:51%;background:#173e54;transform:scaleX(0);transition:transform .4s cubic-bezier(.2,.8,.2,1)}
.tbx-1277::before{left:0;transform-origin:left}.tbx-1277::after{right:0;transform-origin:right}
.tbx-1277__left,.tbx-1277__right{font-size:13px;color:#217f9b;transition:transform .4s,color .4s}
.tbx-1277:hover::before,.tbx-1277:hover::after,.tbx-1277:focus-visible::before,.tbx-1277:focus-visible::after{transform:scaleX(1)}
.tbx-1277:hover,.tbx-1277:focus-visible{color:white;box-shadow:0 12px 30px #173e542d}
.tbx-1277:hover .tbx-1277__left,.tbx-1277:focus-visible .tbx-1277__left{transform:translateX(-5px);color:#a9e7fb}
.tbx-1277:hover .tbx-1277__right,.tbx-1277:focus-visible .tbx-1277__right{transform:translateX(5px);color:#a9e7fb}
.tbx-1277:focus-visible{outline:3px solid #69bcde;outline-offset:4px}
@media(prefers-reduced-motion:reduce){.tbx-1277,.tbx-1277::before,.tbx-1277::after,.tbx-1277__left,.tbx-1277__right{transition:none}}

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 business sections.

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.