The , , and HTML elements can all produce a striking effect on text. However, the strikethrough line often shares the same color as the text.
Fortunately, CSS can be utilized to alter the color of the strikethrough line. Here's how:
Consider the following code:
<span>
This code will display "black with red strikethrough" with the text in black and the strikethrough line in red. The outer <span> element sets the strikethrough color, while the inner <span> element sets the text color.
The above is the detailed content of How can I change the color of a strikethrough line in HTML?. For more information, please follow other related articles on the PHP Chinese website!