What is the difference between the <del> and <s> tag?

Asked

Viewed 512 times

13

I saw about the tags <del> and <s>, say that one is to be used in texts/phrases not relevant and another to "delete" part of the text, but when using both tags the effect is the same (a line crossing the sentence) . What’s the difference? Changes something I use one or the other?

3 answers

11


Visually speaking the result is the same, but the intention is different, the html tags serve for markup, as the name suggests, ie, it delimits the content, html serves to separate the parts.

<del>

A text that a part has been deleted, and a new part has been inserted.

<s>

Marks a text that is not correct

Source

Although the visual result is the same, the intention is different, a front-end can treat the two tags with a different formatting, if you formatted your text with the real meaning of the tags the style of the front-end will be applied correctly.

1

The tag <del> is used to identify text that has been deleted from a document, but retained to show the history of modifications made to the document. Pair an element with <del> with an element <ins> to identify the inserted text that replaced the deleted text.

Example

A enciclopédia mais importante do mundo é <del>Enciclopédia Britânica</del> <ins>Wikipedia</ins>.

inserir a descrição da imagem aqui

The tag <s> is used to identify texts that are no longer accurate or relevant. It is similar to, but semantically distinct from, the tag <del> which is used to identify document edits.

inserir a descrição da imagem aqui

-4

The <s> is a tool made so that the person who looks at the code has the knowledge that that information must be changed or corrected. Understand the <s> as a kind of warning.

the <del>, in turn, causes the text not to be rendered!

  • As such not rendered?

  • 2

    Where did you get that del does not render the text? By default, both the del as to the s show the text the same way ("crossed out"), see here and here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.