How to do a strikethrough with CSSHow to do a strikethrough with CSS

Posted June 13th, 2009 in HTML and CSS

This very short post covers something most people who work with CSS should already know how to do: how to do a strikethrough with CSS. I needed to do this today but didn't know which property sets it so had to look it up. I usually find by writing a short post like this I remember it in the future and never need to look it up again :)

The property and value to make text with a strikethrough is:

text-decoration: line-through

And an example:

this text is struck through

An example of making a CSS class have strikethrough text (and you can probably guess from the class name what sort of text I was putting a line through):

.fullprice {
    text-decoration: line-through;
}

Related posts:

Share or Bookmark

Share or Bookmark this page using the following services. You will need to have an account with the selected service in order to post links or bookmark this page.

Subscribe or Follow

Subscribe via RSS or email, or follow me on Facebook or Twitter below. The RSS icon takes you through to Feedburner where you can select the service or application to use.

Comments

blog comments powered by Disqus