Quantcast
Channel: CSS strikethrough different color from text? - Stack Overflow
Browsing all 17 articles
Browse latest View live

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 Article


Answer 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 Article


Answer 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 Article

Answer by Humayoun for CSS strikethrough different color from text?

If it helps someone you can just use css propertytext-decoration-color: red;

View Article

Answer 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 Article


Answer 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 Article

Answer by Eugene Kardash for CSS strikethrough different color from text?

Here you go:<style>body {color: #000;}</style><del>&nbsp;&nbsp;<span style="color:#999">facebook</span>&nbsp;&nbsp;</del>

View Article

Answer 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 Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Image may be NSFW.
Clik here to view.

Answer 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 Article

Answer 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 Article


Answer 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 Article

CSS 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

Browsing all 17 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>