{"id":362018,"date":"2022-01-26T06:26:49","date_gmt":"2022-01-26T14:26:49","guid":{"rendered":"https:\/\/css-tricks.com\/?p=362018"},"modified":"2023-01-31T12:26:52","modified_gmt":"2023-01-31T20:26:52","slug":"css-borders-using-masks","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/css-borders-using-masks\/","title":{"rendered":"Fancy\u00a0CSS Borders Using Masks\u00a0(Zig-Zag,\u00a0Wavy, and More)"},"content":{"rendered":"\n

Have you ever tried to make CSS borders in a repeating zig-zag pattern? Like where a colored section of a website ends and another differently colored section begins \u2014 not with a straight line, but angled zig zags, rounded humps, or waves. There are a number of ways you could do this sort of CSS border, dating all the way back to using a background-image<\/code>. But we can get more modern and programmatic with it. In this article, we\u2019ll look at some modern CSS mask techniques to achieve the look.<\/p>\n\n\n\n\n\n\n\n

Before we dig into the technical parts, though, let\u2019s take a look at what we are building. I have made a CSS border generator<\/a> where you can easily generate any kind of border within a few seconds and get the CSS code.<\/p>\n\n\n\n

\n