html code help?

How can I change the color of the strikethough effect without changing the color of the font for the word itself to be the same as well. e.g. to have a red strikethrough crossing a black word. i dont want them to be the same color. and i need to be able to do it with html/css/text.

Public Comments

  1. This is not possible in CSS2 *as you present it*, since the strike color is the same as the text color according to CSS2 spec: http://www.w3.org/TR/REC-CSS2/text.html#propdef-text-decoration This does *not* mean that you cannot accomplish this. You need to be thinking along the lines of displaying a line (for instance, a <hr>) *over* text that has the position:absolute or position:relative attribute. You will have to experiment, but you can see that *I* can get 3D-text effects using this: http://www.jimpettis. com/irservic/themes/index.htm (note: problem posting links - remove space before com) I hope this helps. Jim
  2. There is no way. Throwing a horizontal rule over a strikethrough would require a transparent div overlay and makes much more work than you need. Nevermind block some of the text because horizontal rules are thicker unless you specify the width of the rule in the stylesheet. You can do this with sIFR, an image, or Flash though.
  3. Like many things with css it can be done but its not always pretty. I wasnt sure if it was possible to do it, i have made some tests and it can be done. But there isnt an easy way to make it so, but here it is. <del>twenty</del> <span style="display: inline; width: 60px; text-decoration: line-through; color: red; margin-left:-50px; "> nbsp nbsp nbsp nbsp nbsp nbsp </span> The del will provide a strike through but it will be in the color of the text. The span has many styles on it, the margin left moves the span over ontop of the text. The text-decoration makes a strike through. You will need the same number of spaces as are in the del tag. You'll probably have to change the margin-left and the width as well. You'll also have to make sure they are nbsp entities. Its stripping out the other tags.
Powered by Yahoo! Answers