Home > Article > Web Front-end > How to remove underline in css
In css, you can use the "text-decoration" attribute to cancel the underline. You only need to set the "text-decoration:none" style to the element. The text-decoration attribute is used to add decoration to the text. When the value is "none", you can define unmodified standard text.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Canceling underline in css can be achieved using the text-decoration:none style.
Example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>取消下划线</title> <style> a{ text-decoration:none } </style> </head> <body> 欢迎来到<a href="https://www.cctv.com/">我的世界</a>! </body> </html>
The effect is as follows:
The text-decoration attribute specifies the decoration added to the text.
Note: The modified color is set by the "color" attribute.
This attribute allows setting certain effects on text, such as underlining. If the descendant element does not have its own decorations, the decorations set on the ancestor element will "extend" to the descendant elements. User agents are not required to support blink.
Attribute value:
none Default. Text that defines the standard.
underline Defines a line under the text.
overline Defines a line on the text.
line-through defines a line that passes under the text.
blink Defines blinking text.
inherit specifies that the value of the text-decoration attribute should be inherited from the parent element.
Recommended learning: css video tutorial
The above is the detailed content of How to remove underline in css. For more information, please follow other related articles on the PHP Chinese website!