← All elements

Stitched Patch Border

by @admin · 0 views

<div class="stp"><b>HANDMADE</b><span>in small batches</span></div>

About this border

A fabric patch with a dashed stitch line inset from the edge, built from an outline with a negative offset.

How it works

The patch is a rounded box with a faint diagonal weave from a repeating gradient. The stitching is a dashed outline with a negative offset, which pulls it inside the edge without adding any elements. On hover the offset grows, as if the thread were drawn tighter.

Ways to customise it

  • Change #1f4e5f and #f2cc8f for other fabric and thread colours.
  • Change the -10px offset to move the stitch line.
  • Edit the two lines of text to make your own label.

Good to know

Outlines follow the border radius in current browsers. An outline does not take up layout space, so the effect never shifts neighbouring content.

Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.

More in Border

View all →