Answer by Evan Lévesque for CSS strikethrough different color from text?
This can be achieved by placing a span inside an element and assigning each a distinct color.<s style="color: red;"><span style="color: black;">Lorem ipsum dolor sit...
View ArticleAnswer by Julio Spinelli for CSS strikethrough different color from text?
Just an update, this can be easily done now by doing:text-decoration: underline;text-decoration: underline dotted;text-decoration: underline dotted red;text-decoration: green wavy...
View ArticleAnswer by Najam Us Saqib for CSS strikethrough different color from text?
Single Property solution is:.className { text-decoration: line-through red;};Define your color after line through property.
View ArticleAnswer by Humayoun for CSS strikethrough different color from text?
If it helps someone you can just use css propertytext-decoration-color: red;
View ArticleAnswer by Vishnu SR for CSS strikethrough different color from text?
This CSS3 will make you line through property more easier, and working fine. span{ text-decoration: line-through; text-decoration-color: red;}
View ArticleAnswer by Rohin Tak for CSS strikethrough different color from text?
If you do not care about internet explorer\edge, then simplest way to achieve different color for strike-through would be to use CSS property: text-decoration-color in conjunction with...
View ArticleAnswer by Eugene Kardash for CSS strikethrough different color from text?
Here you go:<style>body {color: #000;}</style><del> <span style="color:#999">facebook</span> </del>
View ArticleAnswer by Brady Edgar for CSS strikethrough different color from text?
In my experience the<span style='color:red;text-decoration:line-through'><span style='color:black'>black with red strikethrough</span></span>isn't the best option. I had a co...
View ArticleAnswer by anoldermark for CSS strikethrough different color from text?
Blazemonger's reply (above or below) needs voting up - but I don't have enough points.I wanted to add a grey bar across some 20px wide CSS round buttons to indicate "not available" and tweaked...
View ArticleAnswer by Blazemonger for CSS strikethrough different color from text?
I've used an empty :after element and decorated one border on it. You can even use CSS transforms to rotate it for a slanted line. Result: pure CSS, no extra HTML elements! Downside: doesn't wrap...
View ArticleAnswer by simbo for CSS strikethrough different color from text?
Here's an approach which uses a gradient to fake the line. It works with multiline strikes and doesn't need additional DOM elements. But as it's a background gradient, it's behind the text...del,...
View ArticleAnswer by ibolmo for CSS strikethrough different color from text?
Adding to @gojomo you could use :after pseudo element for the additional element. The only caveat is that you'll need to define your innerText in a data-text attribute since CSS has limited content...
View ArticleAnswer by kpowz for CSS strikethrough different color from text?
Assigning the desired line-through color to a parent element works for the deleted text element (<del>) as well - making the assumption the client renders <del> as a...
View ArticleAnswer by Mechanical snail for CSS strikethrough different color from text?
As of Feb. 2016, CSS 3 has the support mentioned below. Here is a snippet from a WooCommerce's single product page with price discount/*Price before discount on single product page*/body.single-product...
View ArticleAnswer by Aximili for CSS strikethrough different color from text?
Here is a sample jQuery implementation – thanks to gojomo's answer and utype's suggestion (+1 for both)$(function(){ //=================================================================== // Special...
View ArticleAnswer by gojomo for CSS strikethrough different color from text?
Yes, by adding an extra wrapping element. Assign the desired line-through color to an outer element, then the desired text color to the inner element. For example:<span...
View ArticleCSS strikethrough different color from text?
The HTML elements del, strike, or s may all be used for a text strike-through effect. Examples:<del>del</del>....gives: del<strike>strike</strike> and...
View Article