How to make your text crossed out with a red line? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 24

How to make your text crossed out with a red line?

I tried to use <del> tags. It's nice that they make the text between them crossed out but the crossing is the same color as text. I'd like to make it look like an error someone crossed out. I think a red line over black text is what I need to make it happen.

22nd Feb 2020, 8:35 AM
Alex
Alex - avatar
2 Respostas
+ 40
Well, that's really easy to do with CSS. You need to use text-decoration-color property and set it to any color you desire. In your case it's red. del { text-decoration-color: red; } BTW text-decoration-color works with other HTML elements as well. Hence you can style your hyperlinks with it as well.
22nd Feb 2020, 8:46 AM
šŸ‡ŗšŸ‡¦ Vitya šŸ‡ŗšŸ‡¦
šŸ‡ŗšŸ‡¦ Vitya šŸ‡ŗšŸ‡¦ - avatar
+ 20
Thank you Vitya text-decoration-color works šŸ‘
22nd Feb 2020, 10:15 AM
Alex
Alex - avatar