Home > Article > Web Front-end > How to cancel underline in css
Methods to remove underlines in CSS are: text-decoration: none; text-decoration: underline none; outline: none; tags with text-decoration: none; using a text editor.
Removing underline in CSS
To remove underline in CSS, there are several methods:
1. Use text-decoration: none;
This is the most direct method, which can remove all decorative lines from the text, including underlines .
<code class="css">a { text-decoration: none; }</code>
2. Usetext-decoration: underline none;
If you only want to remove the underline of the text while retaining other decorative lines ( Such as strikethrough), you can use this method.
<code class="css">a { text-decoration: underline none; }</code>
3. Use the outline: none;
##outline attribute to control the outline style of the element, including outline lines . Set this to
none to remove both the outline and underline of the element.
<code class="css">a { outline: none; }</code>
4. Use the tag
tag to mark text for inserted content. By default, the
tag adds an underline, but this style can be overridden.
<code class="css">ins { text-decoration: none; }</code>
5. Use a text editor
In addition, you can also make modifications directly in the text editor. For example, in Microsoft Word, you can remove underlines by selecting the text, right-clicking, and unchecking the Underline option.The above is the detailed content of How to cancel underline in css. For more information, please follow other related articles on the PHP Chinese website!