總結css中text-decoration的定義和用法

來源:互聯網
上載者:User
text-decoration 定義和用法

  規定添加到文本的修飾。

注釋:修飾的顏色由 "color" 屬性設定。

none :  無裝飾blink :  閃爍underline :  底線line-through :  貫穿線overline :  上劃線

說明:
檢索或設定對象中的文本的裝飾。
有href特性的a,以及u,ins對象預設值為underline 。
對象strike,s,del,預設值是line-through。
沒有文本的對象此屬性不會作用。
對應的指令碼特性為textDecoration。請參閱我編寫的其他書目。
樣本:

div { text-decoration : underline; } div { text-decoration : underline overline; }

假如 none 值在屬性聲明的最後,所有的先前的其他取值都會被清除。例如,聲明 text-decoration: underline overline blink none 等於聲明 text-decoration: none 。
假如對象沒有文本(如 img 元素)或者是空元素(如:<EM></EM>), 此屬性不會發生作用。
假如你設定 body 對象的此屬性值為 none , a 對象將依然保持其原有的底線樣式。除非你針對 a 對象聲明此屬性值。

text-decoration 是用來規定添加到文本修飾的一種屬性.

h1 {text-decoration:overline}h2 {text-decoration:line-through}h3 {text-decoration:underline}h4 {text-decoration:blink}

inherit 規定應該從父元素繼承 text-decoration 屬性的值.
所有主流瀏覽器都支援 text-decoration 屬性.
任何的版本的 Internet Explorer (包括 IE8)都不支援屬性值 "inherit".
IE、Chrome 或 Safari 不支援 "blink" 屬性值.

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.