How 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:
- Using CSS letter-spacing to space out titles (Saturday, April 18th 2009)
- Blockquotes and XHTML Strict (Saturday, April 11th 2009)
- Multiple CSS classes for a single element (Saturday, March 21st 2009)
- How to make a font italic with CSS (Saturday, February 21st 2009)
- Using !important with CSS (Saturday, January 31st 2009)
- Remove cellpadding and cellspacing from an HTML table with CSS (Wednesday, November 5th 2008)

Comments
blog comments powered by Disqus