TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Corner Border Sweep

Fine lines extend from all four corners to complete a subtle outline around a call-to-action button.

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-1013" type="button"><span>View company profile</span></button>
CSS
.tbx-1013{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:174px;min-height:52px;padding:13px 21px;border:1px solid #c7d6e4;border-radius:3px;background:#fff;color:#18334d;font:650 13px/1.5 system-ui,sans-serif;cursor:pointer;isolation:isolate}
.tbx-1013::before,.tbx-1013::after{content:"";position:absolute;width:0;height:0;pointer-events:none;transition:width .32s ease,height .32s ease}
.tbx-1013::before{top:-1px;left:-1px;border-top:2px solid #317c9e;border-left:2px solid #317c9e}
.tbx-1013::after{bottom:-1px;right:-1px;border-bottom:2px solid #317c9e;border-right:2px solid #317c9e}
.tbx-1013:is(:hover,:focus-visible)::before,.tbx-1013:is(:hover,:focus-visible)::after{width:calc(100% + 2px);height:calc(100% + 2px)}
.tbx-1013:focus-visible{outline:3px solid #7b65db;outline-offset:5px}
@media(prefers-reduced-motion:reduce){.tbx-1013::before,.tbx-1013::after{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 navigation menus.

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.