Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cufon: Underline Text

How can I underline a text replaced with Cufon?

like image 471
Haris Avatar asked Jul 23 '10 06:07

Haris


3 Answers

text-decoration is not supported by Cufon:
https://github.com/sorccu/cufon/wiki/known-bugs-and-issues

Perhaps you could add a border-bottom property to the element using normal CSS?

like image 172
Chris McFarland Avatar answered Nov 05 '22 04:11

Chris McFarland


Cufon adds a class to the elements it creates that you can style (useful if your containing element has pads/margins). So for a link, just use this:

a .cufon {border-bottom: solid 1px #000000}
a:hover .cufon {border-bottom: none}

To keep your elements from shifting up/down, either add a border to the non hover state, or adjust the heights of both elements accordingly...

like image 29
Alex Avatar answered Nov 05 '22 05:11

Alex


Be aware though. Adding a border bottom to a cufon class is quite ugly.

I'd be best to avoid underlines to these fonts in your design. It might look nice in Photoshop, but don't show this to you customers. It doesn't work out that well in HTML/CSS.

like image 44
Rick Avatar answered Nov 05 '22 04:11

Rick