Create an HTML <s> Element Online
The HTML Strikethrough Generator wraps plain text in an <s> element. According to the
HTML Standard
, this element identifies content that is no longer accurate or relevant, such as an original price shown beside a current sale price.
Use <s> when the old information remains useful for comparison or context. If the markup must identify text removed during a document edit, use <del> instead.
Strikethrough Generator Options
- Text sets the plain-text content placed inside the generated
<s>element.
Characters with special meaning in HTML are escaped before the preview and generated markup are updated. Entered tags remain visible text instead of becoming active HTML elements.
Create an HTML <s> Element in C#
The C# panel shows how to create the configured <s> element with
Aspose.HTML for .NET
. The generated code follows this workflow:
- Create an
HTMLDocument. - Create an
ElementnamedswithCreateElement(). - Assign the entered text through
TextContent. - Add the element with
AppendChild()and writestrikethrough.htmlwithSave().
Enter the text first, then copy the updated C# code into your .NET project.
HTML <s> Tag Generator FAQ
1. When should I use the HTML s element?
Use <s> when text is no longer accurate or relevant but should remain visible for context. A previous price displayed beside a current sale price is a typical example.
2. What is the difference between s and del?
The <s> element marks information whose accuracy or relevance has changed. The <del> element records content removed as part of a document edit and can carry cite and datetime attributes describing that change.
3. Should I use s only to draw a line through text?
No. Use <s> when the crossed-out text has the meaning of outdated or no-longer-relevant information. For a purely visual line-through effect without that meaning, apply the CSS text-decoration property to a suitable element.
4. Does the s element remove or hide its text?
No. The content remains in the document, can be copied, and may still be read by assistive technology. Do not use strikethrough markup to conceal private or superseded information that must not be exposed.
5. How can I make the change clear without relying only on strikethrough styling?
Add nearby text that states the current information, such as a new price or corrected status. The surrounding wording should communicate the change even when the visual line is not perceived.
Get Started with Aspose.HTML for .NET API
Install Aspose.HTML for .NET from NuGet with the .NET CLI:
dotnet add package Aspose.HTML
You can also use the NuGet Package Manager UI or run Install-Package Aspose.HTML in the Package Manager Console. See the
installation guide
for setup details, or request a
temporary license
to evaluate the API without evaluation limitations.
Other Supported HTML Generators
Create and preview markup for other common HTML elements.