我想使用我在rails應用程序中設置的標誌符號圖標。Rails link_to標記標記與樣式化的圖形
我想讓圖標成爲另一個頁面的鏈接,但不能使用標準引導樣式,因爲我已經爲我的頁面樣式定製了鏈接。
我不斷收到關鍵字類錯誤 - 有誰知道爲什麼?
謝謝。
我有我的看法如下鏈接:
<li><%= link_to <span class="glyphicon glyphicon-comment"></span>, page_path('messages') %> </li>
我也有CSS如下:
span.glyphicon-comment {
vertical-align:middle;
margin:auto;
padding:10px;
font-size: 2em;
text-align: right;
a:link {text-decoration:none; background-color:transparent; color:grey;};
a:visited {text-decoration:none;background-color:transparent; color:grey;};
a:hover {text-decoration:none;background-color:transparent; color:dark grey;};
a:active {text-decoration:none;background-color:transparent; color:grey;};
}
你可以發佈你的自定義樣式的鏈接?我認爲冰人的解決方案非常清楚。 http://jsfiddle.net/EX8th/ –
嗨 - 我使用的CSS是以上(span.glyphicon評論。 – Mel
這意味着不是鏈接標籤,但span標籤。所以,現在,你的問題是'得到一個語法錯誤:語法錯誤,意外的keyword_ensure,期待keyword_end.',是不是?你可以發佈startrace時,當你訪問該鏈接? –