how to remove the dotted line around the clicked a element in html

前端 未结 8 2319
甜味超标
甜味超标 2020-11-30 21:09

I found that if there is a a link in the page which does not link to a new page,then when user click it,there will be a dotted line around the element,it will o

相关标签:
8条回答
  • 2020-11-30 21:24

    Like @Lo Juego said, read the article

    a, a:active, a:focus {
       outline: none;
    }
    
    0 讨论(0)
  • 2020-11-30 21:25

    To remove all doted outline, including those in bootstrap themes.

    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 should add link href for bootstrap css before the main css, so bootstrap doesn't override your style.

    0 讨论(0)
  • 2020-11-30 21:27
    a {
        outline: 0;
      }
    

    But read this before change it:

    removing-the-dotted-outline

    0 讨论(0)
  • 2020-11-30 21:29

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

    button::-moz-focus-inner {
      border: 0;
    }
    
    0 讨论(0)
  • 2020-11-30 21:30

    Use outline:none to anchor tag class

    0 讨论(0)
  • 2020-11-30 21:31

    Its simple try below code --

    a{
    outline: medium none !important;
    }
    

    If happy cheers! Good day

    0 讨论(0)
提交回复
热议问题