You can also use the tag for crossed-out text, which is more semantically correct. So if you want your text to be easily legible, it’s best not to use it. A line-through is usually used to cross out text that is no longer relevant. So, you could potentially overline, underline, and line-through a text, but you wouldn’t want to do this because it would make it entirely illegible! When shouldn’t you use a line-through? This would give you a line above and below the text with a dashed style. For instance, if you wanted to have a line above and below the text, you would do the following: text-decoration-line: overline, underline You can also use multiple values for text-decoration-line and text-decoration-style. This would underline the word and italicize it. So, for instance, if you wanted to underline and italicize a word, you would do the following: text-decoration: underline, italics You would do this by adding multiple values to the text-decoration property separated by commas. Yes, you can use multiple text decorations in CSS. Can you use multiple text decorations in CSS? This will remove any strikethrough from your text. If you want to remove the CSS strikethrough from your text, you can use the none value for the text-decoration property. More CSS Courses How do I remove the CSS strikethrough? From there, you could remove the text-decoration strike from every H2 by changing a single line rather than having to change each independent H2. For instance, say you had the following code: H2 But what CSS does is make it easier to change your page dynamically if desired. But this also means that you would need to find every instance of the tag if you ever wanted to modify it.įor the most part, CSS can’t do anything that HTML cannot. It can be easier to do this than use CSS to strike text through. The HTML strikethrough tag is used to denote text that has been struck through. How do you use the strikethrough HTML tag? These properties can change the line, style, and color that is placed on the text, such as an underline in blue.
Sets the color of the line added by text-decoration-line. Sets the style of the line added by text-decoration-line. In addition to other text-decoration attributes, there are also other text-decoration properties: What are other text decoration properties? Overlines are also fairly rarely used they’re like an underline but above the text instead. Now, blink used to be very popular in the old days, but it’s considered to be obnoxious bordering on potentially dangerous (for those who have seizures). Removes any text decoration from the text. Causes the text to blink (not supported in all browsers). The possible values for this property are as follows: Text decoration in CSS is used by adding the text-decoration property to an element. In conversational writing, a strikethrough can be used to “censor” oneself, to delete something that one should not say. In the above list, you’d know that the server was up, the HTML had been uploaded, but the CSS still needed to be tested.Īlternatively, it could be used to cross out something that was never correct. While it can be stylistic, since it’s difficult to read, it’s usually used to cross-off information that you still want there.įor instance, line-through text could be used in a list: Line-through text denotes that something is no longer relevant.
COMPLETELY REDONE – The only course you need to learn web development – HTML, CSS, JS, Node, and More! | By Colt Steele Explore Course What does strikethrough text denote?