text-decoration
作什麼用?
實作「購物車清單」時,我們在 app/views/carts/index.html.erb 中有以下代碼:
<div class="row">
<div class="col-md-12">
<%= link_to("清空購物車", clean_carts_path ,
method: :delete , class: "pull-right",
style: "text-decoration: underline;",
data: { confirm: "你確定要清空整個購物車嗎?"} )%>
<!-- 下略 -->
CSS 中 text-decoration 這個性質(property),顧名思義,就是讓我們為文字作裝飾;裝飾像是:增加底線、刪除線、上線。利用 text-decoration:文字特效參數
,我們可以達到以下效果: