Jump to content

Non Central Strike Through


UKFLATLANDER

Recommended Posts

Hi, I'm a bit new to all this so bear with me, not sure if this should be in this section or the html. I want to strike through text but have the striking line offset from the middle. When strikng out numbers a centrally placed line can make reading the orginal number quite difficult.Any ideas gratefully received.

Link to comment
Share on other sites

You can have negative margin-bottom with a border-bottom :)There is no technically correct way to do it, however.

Link to comment
Share on other sites

You could do it, by putting the strikethrough in one element, and have a different font size in another element:Here's a little example. It's best to put styles in a stylesheet:

<span style="text-decoration: line-through; font-size: 40px;"><span style="font-size: 16px">AAA</span></span>

Link to comment
Share on other sites

Thanks for the reply, but when I try this approach the strike through still end up in the middle of the text, even though the text is spaced more widely due to the 40px element.

You could do it, by putting the strikethrough in one element, and have a different font size in another element:Here's a little example. It's best to put styles in a stylesheet:
<span style="text-decoration: line-through; font-size: 40px;"><span style="font-size: 16px">AAA</span></span>

Link to comment
Share on other sites

I tested the code using standards compliant mode in Firefox. I'm not sure how it would be rendered in other browsers. You should always have your pages in standards compliant mode (by adding a <!DOCTYPE> tag at the beginning of the page)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...