0

第一次在这里提问,其实有点紧张!哈哈

无论如何,删除线有问题。我在 Mac 上使用 Safari,但没有显示该行。在 Chrome 上尝试过,它似乎可以工作。

那么,有没有解决方法?这是我正在尝试使用的 CSS 代码

.astroTitle {
color: rgba(233,160,62,1.00);
font-family: Verdana, Tahoma, "Trebuchet MS";
font-size: 18px;
font-weight: bold;
background-color: rgba(82,4,5,0.58);
border-style: solid;
border-width: 2px 2px 2px 2px;
border-color: rgba(184,113,1,0.77);
}
.astroStrikeTitle {
text-decoration: line-through wavy rgba(108,108,255,0.75);
}

然后我只是使用跨度

<span class="astroStrikeTitle">some text</span>

我什么也得不到。

同样,它在 Chrome 上运行良好。只是不在Safari上。:/

4

2 回答 2

0

您需要更具体地使用您的-webkit. 请尝试以下方法:

.astroStrikeTitle {
  text-decoration-line: line-through;
  -webkit-text-decoration-line: line-through;
  text-decoration-color: red;
  -webkit-text-decoration-color: red;
}
.astroTitle {
color: rgba(233,160,62,1.00);
font-family: Verdana, Tahoma, "Trebuchet MS";
font-size: 18px;
font-weight: bold;
background-color: rgba(82,4,5,0.58);
border-style: solid;
border-width: 2px 2px 2px 2px;
border-color: rgba(184,113,1,0.77);
}
<span class="astroStrikeTitle">some text</span>

于 2021-12-21T13:13:56.960 回答
0

这是您问题的答案:https ://stackoverflow.com/a/51254417/4527878

也总是在这里检查 mdn 文档以获得支持:https ://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration

针对您的问题:

.astroStrikeTitle {
  text-decoration: line-through wavy;
  -webkit-text-decoration-line: line-through wavy;
  color: rgba(108,108,255,0.75);
}
于 2021-12-21T13:17:21.910 回答