Is it possible to apply a strikethrough to text using CSS?
If so, is it considered bad practice to do so?
Are there any supportability issue?
Thanks,
Debbie
| SitePoint Sponsor |





Is it possible to apply a strikethrough to text using CSS?
If so, is it considered bad practice to do so?
Are there any supportability issue?
Thanks,
Debbie


<s> and <strike> are deprecated element, but they work better than the CSS alternative, line-through.


Uhm... Surprised I don't see the CORRECT tag for this mentioned.
See, sure <s> and <strike> are deprecated -- IN FAVOR OF <del>
So use DEL. "deleted text" -- renders properly in all browsers, just don't expect the attributes to do anything.
That's one problem with the sitepoint reference -- on the deprecated tags it often fails to list what they were deprecated in favor of... though it is at least mentioned in "additional reading"
Which is part of why I still use the decade old WDG HTML reference -- it's still the best one out there.
http://htmlhelp.com/reference/html40/
See it's entries for S and Strike.
http://htmlhelp.com/reference/html40/fontstyle/s.html
http://htmlhelp.com/reference/html40...le/strike.html
Both of which talk about using DEL -- though for comedy they suggest using both DEL and S. This is the site showing it's age since Nyetscape 4 didn't support DEL while IE5 did.


CSS support can at times be spotty. however, AFIK, "text-decoration:line-trough" only has minor bugs.
<strike> and <s> may still be supported tho. much the same way <font> is deprecated, but you can still use it.Internet Explorer for Windows versions up to and including 6 place the line-through line noticeably higher above the baseline than other browsers.
As usual, that you can still use it doesn't mean you should. Tags convey semantic meaning. Usually a strike through mean information that was deleted ( in fact there is a <del> tag, and <ins>)
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.
Bookmarks