继承文本装饰风格 [英] Inherited Text-Decoration style

查看:146
本文介绍了继承文本装饰风格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何否定或删除父母的文字装饰风格?例如,在下面,文本和锚都有一个文本装饰的直通,有没有一种方法,没有应用于锚标签?

How would I negate or remove a parents text-decoration style? For example in the following, both the text and the anchor have a text-decoration of line-through, is there a way to not have that applied to the anchor tag?

<span style="text-decoration:line-through;">
    Dead Text 
    <a href="#" style="text-decoration:underline;color:Red;">Not Dead Text</a>
</span>

注意:在span中包装内部文本不是一个简单的选项,如果可能,基于css样式的解决方案。

NOTE: wrapping the inner text in a span isn't an easy option with what I have so I'm looking for a solution based on the css styles if possible.

推荐答案

我不相信这是可能的。从 SitePoint

I don't believe it's possible. From SitePoint:


此外,内联框中的文本修饰
在整个框中显示,
即使包含子框。
这也可能看起来类似于
继承。任何文本装饰
在后代框上设置不能
撤消
祖先框的文本修饰。

Also, text decorations on inline boxes are rendered along the entire box, even if it contains descendant boxes. This, too, may appear similar to inheritance. Any text decoration setting on a descendant box can never "undo" the text decorations of an ancestor box.

这篇关于继承文本装饰风格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆