Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1120741 of <s>

  • Revision slug: Web/HTML/Element/s
  • Revision title: <s>
  • Revision id: 1120741
  • Created:
  • Creator: garwoodpr
  • Is current revision? Yes
  • Comment tags and references update

Revision Content

Summary

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 {{ HTMLElement("del") }} and {{ HTMLElement("ins") }} elements, as appropriate.

Content categories Phrasing content or flow content.
Permitted content Phrasing content.
Tag omission {{no_tag_omission}}
Permitted parent elements Any element that accepts phrasing content.
DOM interface {{domxref("HTMLElement")}}

Attributes

This element only includes the global attributes.

DOM interface

This element implements the HTMLElement interface.

Implementation note: Up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element.

Example

<s>Today's Special: Salmon</s> SOLD OUT<br>
<span style="text-decoration:line-through;">Today's Special: Salmon</span> SOLD OUT

Result

Today's Special: Salmon SOLD OUT
Today's Special: Salmon SOLD OUT

See Also

  • The {{ HTMLElement("strike") }} element, alter ego of the {{ HTMLElement("s") }} element is obsolete and should not be used on Web sites any more.
  • The {{ HTMLElement("del") }} element is to be used instead if the data has been deleted.
  • The CSS {{ cssxref("text-decoration") }}-line-through property is to be used to achieve the former visual aspect of the {{ HTMLElement("s") }} element.
{{ HTMLRef }}

Revision Source

<h2 id="Summary">Summary</h2>

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

<table class="properties">
 <tbody>
  <tr>
   <th scope="row"><a href="/en-US/docs/HTML/Content_categories" title="HTML/Content_categories">Content categories</a></th>
   <td><a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content categories#Phrasing content">Phrasing content</a> or <a href="/en-US/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">flow content</a>.</td>
  </tr>
  <tr>
   <th scope="row">Permitted content</th>
   <td><a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">Phrasing content</a>.</td>
  </tr>
  <tr>
   <th scope="row">Tag omission</th>
   <td>{{no_tag_omission}}</td>
  </tr>
  <tr>
   <th scope="row">Permitted parent elements</th>
   <td>Any element that accepts <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="HTML/Content_categories#Phrasing_content">phrasing content</a>.</td>
  </tr>
  <tr>
   <th scope="row">DOM interface</th>
   <td>{{domxref("HTMLElement")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Attributes">Attributes</h2>

<p><span style="line-height:21px">This element only includes the&nbsp;</span><a href="https://developer.mozilla.org/en-US/docs/HTML/Global_attributes" style="line-height: 21px;" title="HTML/Global attributes">global attributes</a><span style="line-height:21px">.</span></p>

<h2 id="DOM_interface">DOM interface</h2>

<p>This element implements the <code><a href="/en-US/docs/DOM/element" title="DOM/element">HTMLElement</a></code> interface.</p>

<div class="note"><strong>Implementation note: </strong>Up to Gecko 1.9.2 inclusive, Firefox implements the <a href="/en-US/docs/DOM/span" title="DOM/span"><code>HTMLSpanElement</code></a> interface for this element.</div>

<h2 id="Example">Example</h2>

<pre class="brush:xml">
&lt;s&gt;Today's Special: Salmon&lt;/s&gt; SOLD OUT&lt;br&gt;
&lt;span style="text-decoration:line-through;"&gt;Today's Special: Salmon&lt;/span&gt; SOLD OUT</pre>

<h3 id="Result">Result</h3>

<p><s>Today's Special: Salmon</s> SOLD OUT<br />
 <s style="text-decoration:line-through">Today's Special: Salmon</s> SOLD OUT</p>

<h2 id="See_Also">See Also</h2>

<ul>
 <li>The {{ HTMLElement("strike") }} element, alter ego of the {{ HTMLElement("s") }} element is obsolete and should not be used on Web sites any more.</li>
 <li>The {{ HTMLElement("del") }} element is to be used instead if the data has been <em>deleted</em>.</li>
 <li>The CSS {{ cssxref("text-decoration") }}-line-through property is to be used to achieve the former visual aspect of the {{ HTMLElement("s") }} element.</li>
</ul>

<div>{{ HTMLRef }}</div>
Revert to this revision