CSS Strikethrough in a Distinct Color
The HTML elements del, strike, and s, as well as the CSS text-decoration property with a value of line-through, allow for text strikethrough effects. However, the strikethrough line typically matches the text color.
Can the Strikethrough Color Be Modified?
Yes, it is possible to change the strikethrough color using CSS by adding an extra wrapping element. Assign the desired line-through color to the outer element and the desired text color to the inner element. For instance:
<span>
This code will display text with a black color and a red strikethrough line.
The above is the detailed content of Can You Change Strikethrough Color in CSS?. For more information, please follow other related articles on the PHP Chinese website!