What is difference between s tag and delete tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is difference between s tag and delete tag

28th Sep 2017, 7:26 AM
Rakesh Gupta
1 Answer
+ 2
The strike tag describes the visual effect being applied to the text, whereas, the delete tag describes the semantic meaning of deleted text. The problem with using strike tag, from HTML 4, is that it strongly couples a style with the name of the tag. HTML 5 made a huge shift away from this by introducing semantic alternatives to tags like <b>, <i>, and <s> with tags like <strong>, <em>, and <del>. The semantic alternatives bring meaning to the content without implying some type of style in the tag name. Now, you can restyle a strong text from bold to highlighted with dashed border. Or an em tag can be bold instead of italicized. Or a deleted text can be grayed out instead of having a strike through. Sure, you could restyle a b tag to not be bold or an i tag to not be italics and so on. However, it's much better to think about markup as content and let CSS handle the styling.
28th Sep 2017, 1:41 PM
David Carroll
David Carroll - avatar