Curly underline
Ever wanted to use un underline on a web page that looks like a spelling mistake in Word? You know, the curly red underline. It's actually very easy.
All you need is:
- A small piece of the wavy line, like this
(it's stretched here for the demo purpose) - A style that uses the image as background
- Align the background at the bottom and repeat only on the x-axis
The style definition would look like:
.curly-underline { background: url(underline.gif) bottom repeat-x; }
And that's it!
I saw this working in TinyMCE, the WYSIWYG editor used by WordPress, for displaying spelling mistakes. Really cool!
Note: If you're a frequent visitor to my site and the example doesn't work for you, chances are you're using a cached version of the CSS file.
This entry was posted on Tuesday, April 4th, 2006 and is filed under CSS. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Get notification for future posts: follow me on Twitter or subscribe to my RSS feed

April 6th, 2006 at 4:24 am
Nice.
May 8th, 2006 at 2:08 am
smart
December 3rd, 2006 at 9:19 am
What about your CSS coding conventions? Shouldn’t you be writing:
.curly-underline {
background-image: url(underline.gif);
background-position: bottom;
background-repeat: repeat-x;
}
December 4th, 2006 at 9:40 am
Very true, Oliver
September 18th, 2009 at 9:51 pm
Great!! just what I was looking for, I cannot thank you enough!
September 30th, 2010 at 3:19 am
Clean – good-looking thank you
January 17th, 2011 at 3:57 pm
http://www.heartratemonitorguides.com/heart-rate-monitor-watches.php Thanks for that awesome posting. It saved MUCH time
May 15th, 2012 at 8:23 am
Thanks a lot!