我正在尝试去除应用于我的元素的 text-decoration: line-through;
样式,但似乎无法做到。我已经尝试使用 text-decoration: none;
,但它不起作用。
当我将 text-decoration: underline;
应用于 span
时,似乎浏览器会添加 underline
样式来代替 line-through
样式。
我知道我可以重写我的 HTML,使需要 line-through
的元素拥有自己的类。我想知道是否有其他方法,而不是重新构造我的 HTML。
<style>
p { text-decoration:line-through; }
span { text-decoration:none; }
</style>
<p>Foo <span>bar</span></p>