css設(shè)置字體下劃線的方法:可以利用text-decoration屬性來進(jìn)行設(shè)置,如【text-decoration: underline;】。text-decoration屬性用于規(guī)定添加到文本的修飾、下劃線、上劃線、刪除線等。
屬性介紹:
text-decoration 屬性規(guī)定添加到文本的修飾,下劃線、上劃線、刪除線等。
(視頻教程分享:css視頻教程)
語法:
/*關(guān)鍵值*/text-decoration: none; /*沒有文本裝飾*/text-decoration: underline red; /*紅色下劃線*/text-decoration: underline wavy red; /*紅色波浪形下劃線*//*全局值*/text-decoration: inherit;text-decoration: initial;text-decoration: unset;屬性值:
none 默認(rèn)。定義標(biāo)準(zhǔn)的文本。
underline 定義文本下的一條線。
overline 定義文本上的一條線。
line-through 定義穿過文本下的一條線。
blink 定義閃爍的文本。
inherit 規(guī)定應(yīng)該從父元素繼承 text-decoration 屬性的值。
舉例:
h1.under { text-decoration: underline;}h1.over { text-decoration: overline;}p.line { text-decoration: line-through;}p.blink { text-decoration: blink;}a.none { text-decoration: none;}p.underover { text-decoration: underline overline;}相關(guān)推薦:css教程