The way to remove the underline style in css is to set the attribute [text-decoration: none;]. If we want to add a style to the text, such as a red wavy line, we can set the attribute [text-decoration: underline red;].
The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.
If we want to cancel the underline style in the text, we can set the attribute text-decoration: none. Let’s introduce the text-decoration attribute below.
The text-decoration attribute specifies the decorations added to the text, such as underline, overline, strikethrough, etc.
text-decoration: none; /*没有文本装饰*/ text-decoration: underline red; /*红色下划线*/ text-decoration: underline wavy red; /*红色波浪形下划线*/
Give some examples:
h1.under { text-decoration: underline; } h1.over { text-decoration: overline; } p.line { text-decoration: line-through; } p.blink { text-decoration: blink; } a.none { text-decoration: none; } p.underover { text-decoration: underline overline; }
Learning video sharing: css video tutorial
The above is the detailed content of How to remove underline style in css. For more information, please follow other related articles on the PHP Chinese website!