Customizing Strikethrough Color in CSS
The , , and HTML tags provide various options for creating text strikethrough effects. Similarly, the CSS text-decoration property with a line-through value can achieve the same effect. However, in most cases, the strikethrough line color matches the text color.
Can CSS be used to differentiate the strikethrough line color from the text color?
Yes, it's possible to create a strikethrough line with a different color using CSS by incorporating an extra wrapping element:
<span>
In this example, an outer <span> element is given a red color and line-through decoration. Within this outer element, an inner <span> element contains the text with a contrasting black color. This approach allows for a distinct strikethrough line color while still maintaining the text color.
The above is the detailed content of Can You Customize Strikethrough Color in CSS?. For more information, please follow other related articles on the PHP Chinese website!