Achieving Multi-Colored Text Strikethroughs with CSS
The HTML elements del, strike, or s and the CSS property text-decoration:line-through can all be used to create strikethrough effects. However, by default, the strikethrough line is the same color as the text.
How to Change the Strikethrough Color
To customize the strikethrough color, an additional wrapping element can be utilized. By assigning the desired line-through color to the outer element and the desired text color to the inner element, a multi-colored strikethrough can be achieved.
For instance, consider the following code snippet:
<span>
In this example, the outer span has a red line-through while the inner span has black text. This results in the text "black with red strikethrough" appearing with a black color and a red strikethrough line.
The above is the detailed content of How to Create Multi-Colored Text Strikethroughs with CSS?. For more information, please follow other related articles on the PHP Chinese website!