diff options
Diffstat (limited to 'devdocs/html/element%2Fs.html')
| -rw-r--r-- | devdocs/html/element%2Fs.html | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fs.html b/devdocs/html/element%2Fs.html new file mode 100644 index 00000000..e8eb27ad --- /dev/null +++ b/devdocs/html/element%2Fs.html @@ -0,0 +1,105 @@ +<header><h1><s>: The Strikethrough element</h1></header><div class="section-content"><p>The <code><s></code> <a href="../index">HTML</a> element renders text with a strikethrough, or a line through it. Use the <code><s></code> element to represent things that are no longer relevant or no longer accurate. However, <code><s></code> is not appropriate when indicating document edits; for that, use the <a href="del"><code><del></code></a> and <a href="ins"><code><ins></code></a> elements, as appropriate.</p></div> +<h2 id="try_it">Try it</h2> +<div class="section-content"> +<iframe class="interactive is-tabbed-shorter-height" height="200" src="https://interactive-examples.mdn.mozilla.net/pages/tabbed/s.html" title="MDN Web Docs Interactive Example" loading="lazy"></iframe> <figure class="table-container"><div class="_table"><table class="properties"> <tbody> <tr> <th scope="row"><a href="../content_categories">Content categories</a></th> <td> <a href="../content_categories#phrasing_content">Phrasing content</a>, <a href="../content_categories#flow_content">flow content</a>. </td> </tr> <tr> <th scope="row">Permitted content</th> <td> +<a href="../content_categories#phrasing_content">Phrasing content</a>.</td> </tr> <tr> <th scope="row">Tag omission</th> <td>None, both the starting and ending tag are mandatory.</td> </tr> <tr> <th scope="row">Permitted parents</th> <td> Any element that accepts <a href="../content_categories#phrasing_content">phrasing content</a>. </td> </tr> <tr> <th scope="row">Implicit ARIA role</th> <td><code><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/structural_roles#structural_roles_with_html_equivalents">deletion</a></code></td> </tr> <tr> <th scope="row">Permitted ARIA roles</th> <td>Any</td> </tr> <tr> <th scope="row">DOM interface</th> <td><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement"><code>HTMLElement</code></a></td> </tr> </tbody> </table></div></figure> +</div> +<h2 id="attributes">Attributes</h2> +<div class="section-content"><p>This element only includes the <a href="../global_attributes">global attributes</a>.</p></div> +<h2 id="examples">Examples</h2> +<div class="section-content"> +<div class="code-example"> +<p class="example-header"><span class="language-name">css</span></p> +<pre data-signature="WpxZxZhQia1LnwY5tEUb7e9d65NVrd8svAw4TMawKMU=" data-language="css"><span class="token selector">.sold-out</span> <span class="token punctuation">{</span> + <span class="token property">text-decoration</span><span class="token punctuation">:</span> line-through<span class="token punctuation">;</span> +<span class="token punctuation">}</span> +</pre> +</div> <div class="code-example"> +<p class="example-header"><span class="language-name">html</span></p> +<pre data-signature="n6IwfJsmaEombS6bOmQjxI7kPJLh0ugOWJYr24/9NIk=" data-language="html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>s</span><span class="token punctuation">></span></span>Today's Special: Salmon<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>s</span><span class="token punctuation">></span></span> SOLD OUT<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>br</span> <span class="token punctuation">/></span></span> +<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>span</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>sold-out<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Today's Special: Salmon<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>span</span><span class="token punctuation">></span></span> SOLD OUT +</pre> +</div> +</div> +<h3 id="result">Result</h3> +<div class="section-content"><div class="code-example" id="sect1"> + +<iframe class="sample-code-frame" title="Examples sample" id="frame_examples" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/s/runner.html?id=examples" loading="lazy"></iframe> +</div></div> +<h2 id="accessibility_concerns">Accessibility concerns</h2> +<div class="section-content"> +<p>The presence of the <code>s</code> element is not announced by most screen reading technology in its default configuration. It can be made to be announced by using the CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/content"><code>content</code></a> property, along with the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::before"><code>::before</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::after"><code>::after</code></a> pseudo-elements.</p> <div class="code-example"> +<p class="example-header"><span class="language-name">css</span></p> +<pre data-signature="QHvZ4Z2AJBrl0NhVvYGBcqPmY56YvwoC5NXuIQG2Z3U=" data-language="css"><span class="token selector">s::before, +s::after</span> <span class="token punctuation">{</span> + <span class="token property">clip-path</span><span class="token punctuation">:</span> <span class="token function">inset</span><span class="token punctuation">(</span>100%<span class="token punctuation">)</span><span class="token punctuation">;</span> + <span class="token property">clip</span><span class="token punctuation">:</span> <span class="token function">rect</span><span class="token punctuation">(</span>1px<span class="token punctuation">,</span> 1px<span class="token punctuation">,</span> 1px<span class="token punctuation">,</span> 1px<span class="token punctuation">)</span><span class="token punctuation">;</span> + <span class="token property">height</span><span class="token punctuation">:</span> 1px<span class="token punctuation">;</span> + <span class="token property">overflow</span><span class="token punctuation">:</span> hidden<span class="token punctuation">;</span> + <span class="token property">position</span><span class="token punctuation">:</span> absolute<span class="token punctuation">;</span> + <span class="token property">white-space</span><span class="token punctuation">:</span> nowrap<span class="token punctuation">;</span> + <span class="token property">width</span><span class="token punctuation">:</span> 1px<span class="token punctuation">;</span> +<span class="token punctuation">}</span> + +<span class="token selector">s::before</span> <span class="token punctuation">{</span> + <span class="token property">content</span><span class="token punctuation">:</span> <span class="token string">" [start of stricken text] "</span><span class="token punctuation">;</span> +<span class="token punctuation">}</span> + +<span class="token selector">s::after</span> <span class="token punctuation">{</span> + <span class="token property">content</span><span class="token punctuation">:</span> <span class="token string">" [end of stricken text] "</span><span class="token punctuation">;</span> +<span class="token punctuation">}</span> +</pre> +</div> <p>Some people who use screen readers deliberately disable announcing content that creates extra verbosity. Because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been struck out would adversely affect understanding.</p> <ul> <li><a href="https://www.tpgi.com/short-note-on-making-your-mark-more-accessible/" target="_blank">Short note on making your mark (more accessible) | The Paciello Group</a></li> <li><a href="https://adrianroselli.com/2017/12/tweaking-text-level-styles.html" target="_blank">Tweaking Text Level Styles | Adrian Roselli</a></li> </ul> +</div> +<h2 id="specifications">Specifications</h2> +<div class="_table"><table class="standard-table"> +<thead><tr><th scope="col">Specification</th></tr></thead> +<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-s-element">HTML Standard <br><small># the-s-element</small></a></td></tr></tbody> +</table></div> +<h2 id="browser_compatibility">Browser compatibility</h2> +<div class="_table"><table> +<thead> +<tr id="bct-browser-type"> +<th></th> +<th colspan="6">Desktop</th> +<th colspan="6">Mobile</th> +</tr> +<tr id="bct-browsers"> +<th></th> +<th>Chrome</th> +<th>Edge</th> +<th>Firefox</th> +<th>Internet Explorer</th> +<th>Opera</th> +<th>Safari</th> +<th>WebView Android</th> +<th>Chrome Android</th> +<th>Firefox for Android</th> +<th>Opera Android</th> +<th>Safari on IOS</th> +<th>Samsung Internet</th> +</tr> +</thead> +<tbody><tr> +<th><code>s</code></th> +<td class="bc-supports-yes">1</td> +<td class="bc-supports-yes">12</td> +<td class="bc-supports-yes"><details><summary>1</summary>Before Firefox 4, this element implemented the <code>HTMLSpanElement</code> interface instead of the standard <code>HTMLElement</code> interface.</details></td> +<td class="bc-supports-yes">Yes</td> +<td class="bc-supports-yes">15</td> +<td class="bc-supports-yes">≤4</td> +<td class="bc-supports-yes">4.4</td> +<td class="bc-supports-yes">18</td> +<td class="bc-supports-yes">4</td> +<td class="bc-supports-yes">14</td> +<td class="bc-supports-yes">≤3.2</td> +<td class="bc-supports-yes">1.0</td> +</tr></tbody> +</table></div> +<h2 id="see_also">See also</h2> +<div class="section-content"><ul> <li>The <a href="strike"><code><strike></code></a> element, alter ego of the <a href="s" aria-current="page"><code><s></code></a> element, is obsolete and should not be used on websites anymore.</li> <li>The <a href="del"><code><del></code></a> element is to be used instead if the data has been <em>deleted</em>.</li> <li>The CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-line"><code>text-decoration-line</code></a> property is to be used to achieve the former visual aspect of the <a href="s" aria-current="page"><code><s></code></a> element.</li> </ul></div><div class="_attribution"> + <p class="_attribution-p"> + © 2005–2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br> + <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s</a> + </p> +</div> |
