How to remove dashed line around clicked element in html

I found that if there is a link on the page that does not link to the new page, then when the user clicks on it, there will be a dashed line around the element, it will disappear only when the user clicks something else on the page, how to remove it ?

Example:

enter image description here

Notice the dashed line around the Section 2 element.

+105
html css
Nov 02
source share
8 answers

Use outline:none to bind a tag class

+183
Nov 02 '12 at 12:17
source share

As @Lo Juego said, read the article

 a, a:active, a:focus { outline: none; } 
+51
Nov 02
source share
 a { outline: 0; } 

But read this before changing:

removing-the-dotted-outline

+12
Nov 02 '12 at 12:20
source share

To remove all outlined contours, including bootstrap tags.

 a, a:active, a:focus, button, button:focus, button:active, .btn, .btn:focus, .btn:active:focus, .btn.active:focus, .btn.focus, .btn.focus:active, .btn.active.focus { outline: none; outline: 0; } input::-moz-focus-inner { border: 0; } 

Note. You must add the href link for bootstrap css before the main css, so bootstrap does not override your style.

+7
Jul 15 '15 at 19:31
source share

Try it with !important in css .

 a { outline:none !important; } // it is 'very important' that there is 'no' 'outline' for the 'anchor' tag. Thanks! 
+7
Nov 10 '15 at 4:40
source share

Removing outline damage the availability of the website. So I just leave it there, but make it invisible.

 a { outline: transparent; } 
+3
Sep 27 '18 at 16:44
source share

A simple attempt to make the code below -

 a{ outline: medium none !important; } 

If happy greetings! good afternoon

0
Feb 28 '16 at 18:56
source share

In my case, it was a button, and, apparently, with buttons, this is a problem only in Firefox. The solution is found here :

 button::-moz-focus-inner { border: 0; } 
0
Jul 26 '19 at 17:17
source share



All Articles