How do you cut text in html?

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2022 by Refsnes Data. All Rights Reserved.
W3Schools is Powered by W3.CSS.

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The <strike> HTML element places a strikethrough (horizontal line) over text.

Warning: This element is deprecated in HTML 4 and XHTML 1, and obsoleted in the HTML Living Standard. If semantically appropriate, i.e., if it represents deleted content, use <del> instead. In all other cases use <s>.

Attributes

This element includes the global attributes.

Example

&lt;strike&gt;: <strike>Today's Special: Salmon</strike> SOLD OUT<br />
&lt;s&gt;: <s>Today's Special: Salmon</s> SOLD OUT

The result of this code is:

Specifications

Specification
HTML Standard
# strike

Browser compatibility

BCD tables only load in the browser

See also

  • The <s> element.
  • The <del> element should be used if the data has been deleted.
  • The CSS text-decoration property can be used to style text with a strikethrough.

The <s> HTML element 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.

Try it

Attributes

This element only includes the global attributes.

Examples

.sold-out {
  text-decoration: line-through;
}

<s>Today's Special: Salmon</s> SOLD OUT<br />
<span class="sold-out">Today's Special: Salmon</span> SOLD OUT

Accessibility concerns

The presence of the s element is not announced by most screen reading technology in its default configuration. It can be made to be announced by using the CSS content property, along with the ::before and ::after pseudo-elements.

s::before,
s::after {
  clip-path: inset(100%);
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

s::before {
  content: " [start of stricken text] ";
}

s::after {
  content: " [end of stricken text] ";
}

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.

  • Short note on making your mark (more accessible) | The Paciello Group
  • Tweaking Text Level Styles | Adrian Roselli

Specifications

Specification
HTML Standard
# the-s-element

Browser compatibility

BCD tables only load in the browser

See also

  • The <strike> element, alter ego of the <s> element is obsolete and should not be used on Web sites any more.
  • The <del> element is to be used instead if the data has been deleted.
  • The CSS text-decoration-line property is to be used to achieve the former visual aspect of the <s> element.

How do I cut text in HTML?

The <s> HTML element 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.

Which tag is used to cut the text in HTML?

The <strike> tag defines a strike or line through Text. This tag creates a cut line in the text.

How do you cut a paragraph in HTML?

HTML Line Breaks The HTML <br> element defines a line break.