【问题标题】:How to perform a double strikethrough on text with inline css?如何使用内联 css 对文本执行双删除线?
【发布时间】:2018-07-25 00:26:11
【问题描述】:

我希望我的文本有 2 个删除线,但仅使用内联 CSS

我怎样才能做到这一点?

【问题讨论】:

标签: html css


【解决方案1】:

您可以将del 标记与text-decoration-style: double 一起使用作为双删除线。

<del style="text-decoration-style: double;">Text with double strike through</del>

要对span 或其他标记内的普通文本应用双删除线,您可以使用text-decoration: line-throughtext-decoration-style: double

<span style="text-decoration: line-through; text-decoration-style: double;">Text with double strikethrough</span>

另请参阅:text-decoration-styletext-decoration

【讨论】:

    【解决方案2】:

    你可以使用渐变:

    <span style="background:linear-gradient(#000,#000) 50% 35%/100% 1px no-repeat,linear-gradient(#000,#000) 50% 65%/100% 1px no-repeat;">some text to strike</span>

    【讨论】:

      猜你喜欢
      • 2011-06-18
      • 2014-06-26
      • 2017-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多