DEV Community

Cover image for HTML tags | s
Carlos Espada
Carlos Espada

Posted on • Edited on

3 1

HTML tags | s

It is used to indicate a text that is no longer correct, accurate or relevant, and that is usually rendered with a line through it.

It is not suitable for indicating edits in a document, that's what the <del> and <ins> elements exist for.

The presence of the <s> element is not advertised in most screen readers with the default settings. You can force your ad using the content property of CSS as well as the ::before and ::after pseudo-elements as follows:

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] ";
}
Enter fullscreen mode Exit fullscreen mode

Some screen reader users disable announcing content to avoid excessive verbosity. So it is important not to abuse this technique, avoiding using it whenever possible, except in situations where not knowing that there is a crossed-out content can adversely affect the understanding of the text.

  • Type: inline
  • Self-closing: No
  • Semantic value: No

Definition and example | Support

Agent.ai Challenge image

Congrats to the Agent.ai Challenge Winners 🏆

The wait is over! We are excited to announce the winners of the Agent.ai Challenge.

From meal planners to fundraising automators to comprehensive stock analysts, our team of judges hung out with a lot of agents and had a lot to deliberate over. There were so many creative and innovative submissions, it is always so difficult to select our winners.

Read more →

Top comments (1)

Collapse
 
susomejias profile image
Jesús Mejías Leiva

🙌

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay