2013-10-21 127 views
2

在CSS中,您可以使用背景图像进行自定义下划线。这种技术在此说明:自定义下划线使用对象

http://alistapart.com/article/customunderlines

使用这种技术,我可以做这样的事情:

enter image description here

大虾,我所知道的是使用内联格式的唯一下划线:

text "<u>Ugly Underline</u>", size: 60, inline_format: TRUE 

enter image description here

我对一些细微的差异,但作为一名平面设计师,这使所有的差异。

有谁知道是否有任何技术可以让我做一个使用虾的自定义下划线?

回答

0

我最终使用:对于formatted_text_box回调选项。

class CustomUnderlineCallback 

    def initialize(options) 
    @document = options[:document] 
    end 

    def render_in_front(fragment) 
    @document.stroke_color COLOR_WHITE 
    @document.stroke_polygon fragment.bottom_left, fragment.bottom_right 
    @document.stroke_color COLOR_BLACK 
    end 

end 
0

试试这个:

table([["Does this work?"]] , :cell_style => {:borders => [:bottom]}) 

有选项可以设置border-colorwidth