html – CSS:直线与颜色不同的文字颜色?
发布时间:2020-12-14 22:21:07 所属栏目:资源 来源:网络整理
导读:参见英文答案 CSS strikethrough different color from text?10个答案我想要有一个红色的穿透灰色文本,但这种风格不起作用: color: #a0a0a0;text-decoration: line-through 3px red; 我究竟做错了什么? 解决方法 您可以使用两个嵌套元素来模拟所需的效果
参见英文答案 >
CSS strikethrough different color from text?10个答案我想要有一个红色的穿透灰色文本,但这种风格不起作用:
color: #a0a0a0; text-decoration: line-through 3px red; 我究竟做错了什么? 解决方法
您可以使用两个嵌套元素来模拟所需的效果,例如:
<style type="text/css"> span.inner { color: green; } span.outer { color: red; text-decoration: line-through; } </style> <span class="outer"> <span class="inner">foo bar</span> </span> jsfiddle (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |