CSS |文字-装饰-颜色属性

原文:https://www . geesforgeks . org/CSS-text-decoration-color-property/

此属性用于指定文本上的装饰颜色(上划线、下划线和换行符)。

语法:

text-decoration-color: color|initial|inherit;

属性值:

  • color: Sets the color of the text-decoration. Syntax:

    ```html text-decoration-color: color;

    ```

    示例:

    ```html <!DOCTYPE html>

             text-decoration              h1 {             color: green;         }

    body {             text-align: center;         }

    table {             margin: auto;         }

    th {             padding: 10px 25px;         }

    .underline {             text-decoration: underline wavy;         }

    .overline {             text-decoration: overline solid;         }

    .line-through {             text-decoration: line-through double;         }

    .red td {             text-decoration-color: red;         }

    .green td {             text-decoration-color: green;         }

    .blue td {             text-decoration-color: blue;         }     

        

    GeeksforGeeks

    text-decoration-color: color;

                                                                                                                                                                                                                                                 
    underlineline-throughoverline
    Hello Geeks!Hello Geeks!Hello Geeks!
    Hello Geeks!Hello Geeks!Hello Geeks!
    Hello Geeks!Hello Geeks!Hello Geeks!

    ```

    输出:

  • initial: Sets this property to its default value. Syntax:

    ```html text-decoration-color: initial;

    ```

    示例:

    ```html <!DOCTYPE html>

             text-decoration              h1 {             color: green;         }

    body {             text-align: center;         }

    #example {             text-decoration: underline double;             text-decoration-color: initial;         }     

        

    GeeksforGeeks

        

    text-decoration-color: initial;

        
         This text-decoration-color of this text is set to initial.     

    ```

    输出:

    支持的浏览器:文字-装饰-颜色属性支持的浏览器如下:

    • 谷歌 Chrome 57.0
    • Firefox 36.0
    • Opera 44.0
    • Safari 7.1