2013-10-21 121 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