The text will have to cover several lines, even the title will work with narrow viewports on smartphones.
Here's a multi-line solution made with a linear gradient (well, 2 of them for playing dashes):
Codepen in Scss (just using 2 variables for font size and line height)
span {
font-size: 40px;
line-height: 1.5;
text-decoration: underline wavy red;
background-image:
linear-gradient(to right, white 0, white 50%, transparent 50%, transparent 100%),
linear-gradient(to bottom, blue 0, blue 1px, transparent 1px, transparent 100%);
background-size:
8px 100%,
100% 60px;
background-position: left top, left top;
background-repeat: repeat, repeat;
}
<p><span> Some Text </span></p>
<p><span>Also<br>multiline</span></p>
Run codeHide resultDashes can be freely changed (this is the gradient between transparent and white, their size as you want)
source
share