How to remove underline from a:before using CSS ? Last Updated : 23 Apr, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The a:before is used to create an element before the content of the anchor tag and it displays underlined a:before part by default. To remove the underline from a:before using the text-decoration property of CSS and set element display to inline-block. Syntax: text-decoration:none; display:inline-block; Example 1: This example sets the text-decoration property to none. html <!DOCTYPE html> <html> <head> <title> How to remove underline from a:before using CSS? </title> <style> #test a { color: #05ff05; text-decoration: none; } #test a:before { color: #05ff05; content: "* "; text-decoration: none; display: inline-block; } </style> </head> <body style="text-align:center;"> <h1 style="color:green;">GeeksForGeeks</h1> <h3>Original Link</h3> <a href="https://www.geeksforgeeks.org/">Link 1</a> <br> <div id="test"> <h3>Removed Underline</h3> <a id="GFG" href="https://www.geeksforgeeks.org/"> Link 2 </a> </div> </body> </html> Output: Example 2: This example uses hover property to remove underline when mouse move over the a:before part. html <!DOCTYPE html> <html> <head> <title> How to remove underline from a:before using CSS? </title> <style> #test a { color: #05ff05; } #test a:hover { color: #05ff05; text-decoration: none; } #test a:before { color: #05ff05; content: "**"; } #test a:before:hover { color: #05ff05; content: "**"; display: inline-block; text-decoration: none; } </style> </head> <body style="text-align:center;"> <h1 style="color:green;">GeeksForGeeks</h1> <h3>Original Link</h3> <a href="https://www.geeksforgeeks.org/">Link 1</a> <br> <div id="test"> <h3>Removed Underline</h3> <a id="GFG" href="https://www.geeksforgeeks.org/"> Link 2 </a> </div> </body> </html> Output: Example 3: This example removes the underline only from a:before part. html <!DOCTYPE html> <html> <head> <title> How to remove underline from a:before using CSS? </title> <style> #test a { color: #05ff05; } #test a:before { color: #05ff05; content: "**"; display: inline-block; text-decoration: none; } </style> </head> <body style="text-align:center;"> <h1 style="color:green;">GeeksForGeeks</h1> <h3>Original Link</h3> <a href="https://www.geeksforgeeks.org/">Link 1</a> <br> <div id="test"> <h3>Removed Underline</h3> <a id="GFG" href="https://www.geeksforgeeks.org/"> Link 2 </a> </div> </body> </html> Output: Comment More infoAdvertise with us Next Article How to remove underline from a:before using CSS ? C chaitanyashah707 Follow Improve Article Tags : Web Technologies HTML HTML-Questions Similar Reads How to Remove Underline for Anchors Tag Using CSS? In HTML, anchor (<a>) tags are used to define hyperlinks, and by default, most browsers display them with an underline to signify that they are clickable. While this is the standard behavior, you may want to remove or customize the underline for design purposes.The simplest way to remove the u 2 min read How to Remove Underline from Links in CSS? The text-decoration property is used to remove the underline from links in CSS. You can use the below syntax on anchor element to remove underline from link.Syntaxa { text-decoration: none;}It is very basic to remove underline from link with text-decoration property. The none value removes the under 1 min read How to Underline Text using CSS? To underline a text using CSS, the CSS text-decoration property is used with the value set to underline.Using text-decorationWe use the text-decoration CSS property to underline a text using CSS. The text that is to be underlined is inserted in a <p> tag and the property is applied.Syntaxtext- 1 min read How to remove underline from link using JavaScript? Given a link and the task is to remove the underline from the anchor element with the help of JavaScript. There are two approaches that are discussed below: Approach 1: Use textDecoration property of JavaScript to perform this operation. It can be set to many values but, in this example, it has been 2 min read How to remove border from an editable element using CSS ? Given an HTML document containing some document and the task is to remove border from an editable element using CSS. It is a default behavior of any element which have content-editable attributes set to true whenever, the element gets a focus it will get a border around them. The task can be done by 1 min read Like