Neal said:
For a horizontal strike-through, use the CSS property text-decoration.
span.oldprice {text-decoration: line-through;}
A problem with this is that when CSS is off, there is no indication of
the price being "out". The same applies to any non-visual presentation.
Moreover, as the OP mentioned, the line might be misleading - browsers
implement striking rather poorly.
A more logical approach is something like
<div>Widgets for sale,
<span class="change"><del>$88</del> <ins>$87.95</ins></span>
each!</div>
Since browsers may underline <ins> content by default, I would add
ins { text-decoration: none; }
into the stylesheet, and then consider whether some other, less
misleading indication of "insertion" is needed (different color, or maybe
a red dotted bottom border - probably would not be misunderstood as link
indication).
It might help a little to make the line colored. The simplest way is
probably to add extra markup inside <del>, using
<del><span>$88</span></del>
and a style sheet like
del { color: red; background: transparent; }
del span { color: black; background: transparent; }
For diagonal, there's no simple way.
Yeah, I'd strick to horizontal - or use an image for the entire
expression.
<div>Widgets for sale,
<img alt="old price $88, new price" src="old88.gif">
$87.95 each!</div>
but using an image would have several drawbacks, of course, e.g. fixed
size in pixels, not adapting to text size.
(If such expressions are used a lot, it would make sense to try and find,
or write, a program that generates such images, with the price or other
text passed as data to it. It might be installed as a server-side script,
so that you would use something like <img ... src="/cgi-bin/del?88">.)