Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between <s> and <del> in HTML, and do they affect website rankings?

Tags:

html

seo

tags

What is the difference between <s> and <del>? I have read here that there are semantic differences between <b> and <strong>, does this apply to <s> and <del>? Additionally, how are such semantic differences, if any, interpreted by search engines and what affect would they have on rankings? Are there any other tags that affect search rankings?

like image 703
octref Avatar asked May 24 '13 21:05

octref


People also ask

What is the difference between Del tag and S tag in HTML?

Definition and Usage The <s> tag specifies text that is no longer correct, accurate or relevant. The text will be displayed with a line through it. The <s> tag should not be used to define deleted text in a document, use the <del> tag for that.

Why we use del tag in HTML?

The <del> HTML element represents a range of text that has been deleted from a document. This can be used when rendering "track changes" or source code diff information, for example. The <ins> element can be used for the opposite purpose: to indicate text that has been added to the document.

What is the difference between <s> and <Del> elements in HTML?

The <del> element represents a removal from the document. The <s> represents contents that are no longer accurate or no longer relevant. <s> and <del> both still exist in the HTML specification. The <del> element represents a removal from the document. The <s> represents contents that are no longer accurate or no longer relevant.

What is the difference between tag and element in HTML?

HTML Tag vs Element. "Elements" and "tags" are terms that are widely confused. HTML documents contain tags, but do not contain the elements. The elements are only generated after the parsing step, from these tags. Source: wikipedia > HTML_element An HTML element is defined by a starting tag.

What is the difference between Del and s in a tag?

There is no practical difference between del and s, except that the tag names are different.

What is the difference between HTML and HTML5?

There are many differences between HTML and HTML5 which are discussed below: It didn’t support audio and video without the use of flash player support. It supports audio and video controls with the use of <audio> and <video> tags. It uses cookies to store temporary data. It uses SQL databases and application cache to store offline data.


2 Answers

<s> and <del> both still exist in the HTML specification.

  • The <del> element represents a removal from the document.
  • The <s> represents contents that are no longer accurate or no longer relevant.

That is to say that they actually represent different things semantically. Specifically <del> would be used if you had an existing document and wanted to indicate text that was in the document, but has been removed. This would be different than text in a document that is no longer accurate, but that has not been removed (you could use <s> for that).

You should not use or depend on either for styling even though most browsers do have them strike-through by default. You should only rely on CSS for presentation.

Due to the mercurial nature of how search engines work, it's very difficult to say whether one tag or another will make a difference on how keywords are created and your content is indexed. You should focus on creating good content that is semantically correct, and your website rank will follow.

like image 199
Explosion Pills Avatar answered Oct 22 '22 18:10

Explosion Pills


After reading the existing answer, I left still confused about which one to use in my app. We agree that presentationally they are the same, and the difference mostly comes down to semantics. Mozilla's MDN docs helped clarify the semantics for me.

I think <s> is correct for most use cases, and here's why along with the four relevant options:

  1. <strike>

    It's clear that <strike> is deprecated, and therefore not correct to use anymore.

  2. <s>

    From <s> on MDN:

    The HTML Strikethrough Element (<s>) renders text with a strikethrough, or a line through it. Use the <s> element to represent things that are no longer relevant or no longer accurate. However, <s> is not appropriate when indicating document edits; for that, use the <del> and <ins> elements, as appropriate.**

  3. <del>

    From <del> on MDN:

    The HTML Deleted Text Element (<del>) represents a range of text that has been deleted from a document. This element is often (but need not be) rendered with strike-through text.

    The biggest key to me on this page is that <del>, like <ins>, offers two additional (optional) attributes: cite and datetime which make sense in referring to a change in the context of a document. As a counterexample, if I were updating a restaurant menu, citing a source for a menu item being sold out doesn't seem relevant.

  4. No tag / use CSS

    If none of the above seem correct for your use case, remember that you can still define a custom class.

    .purchased { text-decoration: line-through; }
    <p>Wish list</p>  <ul>    <li class="purchased">New MacBook</li>    <li>Cookies</li>  </ul>
like image 30
Taylor D. Edmiston Avatar answered Oct 22 '22 17:10

Taylor D. Edmiston