Tag <s> In Html

The Tag S is discussed in this article using examples, in an effort to fulfill educational objectives.

Mark up incorrect text as follows:

Example: 

<!DOCTYPE html> <html> <body> <p>The concert of <s>Michael Jackson</s> <ins>Eminem</ins> has been cancelled.</p> </body> </html>

Another example of the <s> tag is shown below:

Example: 

<!DOCTYPE html> <html> <body> <p>It was previously thought that <s>plants do not have the ability to feel pain</s> , but recent studies have shown otherwise.</p> </body> </html>

You can modify the <s> tag with the help of CSS here is how:

Example: 

<!DOCTYPE html> <html> <head> <style> s { text-decoration: line-through; color: gray; } ins { text-decoration: underline; color: maroon; } </style> </head> <body> <p>It was previously thought that <s>plants do not have the ability to feel pain</s> , but recent studies have shown otherwise.</p> </body> </html>


Tag S Usage

The <s> tag indicates that the content is not accurate, relevant, or correct. A line will cross the text. But it is also important to note that <s> tag must never be employed to indicate deleted text in a document. Put the <del> tag there.

The <s> tag in HTML is used to indicate that the content inside the tag is no longer accurate or relevant.

Common Uses

Here are some common uses of the <s> tag:

  • The <s> tag is often used to strike out text that is no longer accurate or relevant, such as when editing a document or updating a webpage.
  • The <s> tag can also be used to clarify content by showing that a particular phrase or sentence should not be taken literally, or that it has been modified in some way.
  • The <s> tag can be used to create a visual effect on text, such as crossing out a word or phrase to indicate that it is no longer valid.
  • The <s> tag can be used to improve the accessibility of content by providing additional information to users with screen readers. By indicating that certain text is no longer accurate or relevant, users can better understand the context of the content.

Attributes

Global

The Tag S <s> also accepts the Global Attributes in HTML.

Event

The Tag S <s> tag also accepts the Event Attributes in HTML.


Browser Compatibility

Element
<s>YesYesYesYesYes

Predefined CSS

The majority of browsers present the <s> element with default values as follows:

s {
text-decoration: line-through;
}

Tag S Advantages

The <s> tag in HTML has several potential advantages, including:

  1. The primary advantage of the <s> tag is that it allows you to easily create text that appears to be crossed out. This can be useful in various contexts, such as indicating that an item is no longer available or that a particular piece of information is no longer accurate.
  2. The <s> tag can be easily styled using CSS, allowing you to customize the appearance of the strikethrough effect. This gives you more control over how the content appears to your users.
  3. While the <s> tag is not as semantically correct as some other HTML tags (such as <del> for deleted content), it still provides a clear indication of the purpose of the content inside it. This can help to improve the readability and maintainability of your code.
  4. The <s> tag is supported by all major web browsers, including Internet Explorer 11 and Microsoft Edge. This means that you can use the <s> tag with confidence, knowing that it will be compatible with the majority of your users’ browsers.
Become a subscriber to our Newsletter to stay in touch with latest technical information.
We value your feedback.
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Subscribe To Our Newsletter
Enter your email to receive a weekly round-up of our best posts. Learn more!
icon

Leave a Reply

Your email address will not be published. Required fields are marked *