日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

在 CSS 中,“text-decoration”屬性用于給文本添加下劃線、上劃線和刪除線。

在文本下劃線表示在文本下方畫一條線,在文本上劃線表示在文本上方畫一條線。刪除文本意味著在文本上畫一條線以顯示文本已被刪除。

在本教程中,我們將學習使用 text-decoration CSS 屬性的不同值來設置不同的文本樣式。

語法

text-decoration: style decoration color thickness;

登錄后復制

    Style——代表裝飾線的風格,如實線、點線、波浪線等

    裝飾-它可以用“下劃線”、“上劃線”和“穿過線”值來裝飾文本。

    顏色 – 設置裝飾線的顏色。

    粗細——用于設置裝飾線的粗細。

    示例

    在下面的示例中,我們使用“text-decoration”CSS 屬性來裝飾文本。我們設置了“實線”線條樣式、紅色“下劃線”裝飾和 5px 粗細,用戶可以在輸出中觀察到。

    <html>
    <head>
       <style>
          .text {
             font-size: 1.2rem;
             text-decoration: solid underline red 5px;
          }
       </style>
    </head>
    <body>
       <h3> Setting the underline to the text using the 'text-decoration' property in CSS </h3>
       <div class = "text">
          This is a text with an underline.
       </div>
    </body>
    </html>
    

    登錄后復制

    示例

    在下面的例子中,我們使用藍色上劃線的方式裝飾了文本。在輸出中,用戶可以觀察文本上方的藍線。

    <html>
    <head>
       <style>
          .text {
             font-size: 1.2rem;
             text-decoration: wavy overline blue 5px;
          }
       </style>
    </head>
    <body>
       <h3> Setting the <i> overline to the text </i> using the 'textdecoration' property in CSS </h3>
       <div class = "text">
          This is a text with an overline.
       </div>
    </body>
    </html>
    

    登錄后復制

    示例

    在此示例中,我們使用了“text-decoration”CSS 屬性和“line-through”值來刪除文本。在輸出中,用戶可以觀察文本上方的行。這樣,我們就可以在不刪除文本的情況下顯示文本中存在錯誤。

    <html>
    <head>
       <style>
          .text {
             font-size: 2rem;
             text-decoration: dotted line-through green 5px;
          }
       </style>
    </head>
    <body>
       <h3> Setting the <i> strickthrough to the text </i> using the 'textdecoration' property in CSS </h3>
       <div class = "text">
          This is a text with a strikethrough.
       </div>
    </body>
    </html>
    

    登錄后復制

    示例

    在此示例中,我們創建了三個具有不同文本的不同 div 元素。我們為每個 div 元素的文本使用了不同的裝飾風格。在輸出中,用戶可以觀察“下劃線”、“上劃線”和“穿線”文本裝飾樣式之間的差異。

    <html>
    <head>
       <style>
          .underline {
             color: grey;
             text-decoration: solid underline yellow 2px;
             font-size: 1.5rem;
          }
          .overline {
             text-decoration: solid overline yellow 3px;
             font-size: 1.5rem;
          }
          .strikethrough {
             text-decoration: solid line-through yellow 2px;
             font-size: 1.5rem;
          }
       </style>
    </head>
    <body>
       <h3> Setting the strikethrough, underline, and overline to the text using the 'text-decoration' property in CSS </h3>
       <div class = "underline"> underline </div>
       <div class = "overline"> overline </div>
       <div class = "strikethrough"> strike through </div>
    </body>
    </html>
    

    登錄后復制

    結論

    本教程教用戶如何使用“text-decoration”CSS 屬性來裝飾文本。用戶可以根據需要使用不同的值對文本進行不同的裝飾。

    以上就是哪個屬性用于使用 CSS 為文本添加下劃線、上劃線和刪除線?的詳細內容,更多請關注www.92cms.cn其它相關文章!

分享到:
標簽:下劃線 劃線 屬性 文本 用于
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定