飞碟不会为以下 HTML 示例呈现删除线:
<s><span style="color: rgb(255, 0, 0);"><span style="background-color: rgb(255, 255, 0);">This is a test </span></span>
</s>
但是,在不使用背景颜色时,删除线可以正确呈现。
如何让飞碟与背景颜色结合时呈现删除线?
6月6日更新
如果我将罢工标签
<s>
移动到跨度标签内,那么它就可以工作:
<span style="color: rgb(255, 0, 0);"><span style="background-color: rgb(255, 255, 0);"><s>This is a test</s></span></span>
您的 CSS 可能有问题。
这是一个显示删除线与飞碟 (9.1.1) 配合使用的示例:
<html>
<head>
<style>
span {
color: rgb(255, 0, 0);
background-color: rgb(255, 255, 0);
}
span.decorated { text-decoration: line-through;}
</style>
</head>
<body>
<span>Without strikethrough</span>
<span class="decorated">With strikethrough</span>
</body>
</html>
结果:
我必须使用
!important
才能在我的情况下工作:
h2 { background-color: rgb(255, 0, 0) !important; }