doubledee — 2011-05-30T20:40:10-04:00 — #1
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?
ralphm — 2011-05-30T20:46:54-04:00 — #2
[<s> and <strike> are deprecated element, but they work better than the CSS alternative, [URL="http://reference.sitepoint.com/css/text-decoration"]line-through](http://reference.sitepoint.com/html/s).
doubledee — 2011-05-30T20:50:31-04:00 — #3
ralphm — 2011-05-30T20:54:16-04:00 — #4
… of browser support. (The linked pages list browser support.)
doubledee — 2011-05-30T22:05:38-04:00 — #5
But if <strike> is deprecated as well, doesn't using that HTML tag create the same issue?
Either way, is it "bad form" to strike-through text online (similat to how many frown upon underlining non-hyperlinked text)?
system — 2011-05-31T01:56:41-04:00 — #6
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.
See it's entries for S and Strike.
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.
dresden_phoenix — 2011-05-31T02:06:34-04:00 — #7
CSS support can at times be spotty. however, AFIK, "text-decoration:line-trough" only has minor bugs.
Internet Explorer for Windows versions up to and including 6 place the line-through line noticeably higher above the baseline than other browsers.
<strike> and <s> may still be supported tho. much the same way <font> is deprecated, but you can still use it.
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>)
doubledee — 2011-05-31T12:17:50-04:00 — #8
You're a wealth of knowledge!