HTML – Remove Dotted Line of Transparent Button

Not only the HTML link will have a dotted outline after being clicked, if you have a transparent input button, you will find the dotted outline too.

 

The following css could help you to remove it.

/*for FireFox*/
input[type="submit"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner {   
  border : 0px;
} 
/*for IE8 */
input[type="submit"]:focus, input[type="button"]:focus {     
  outline : none; 
}


 

Try the following .html.

<html>
  <head>
    <style type="text/css">
      input {
        background-color: transparent;
      }
      /*for FireFox*/
      input[type="submit"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner {   
        border : 0px;
      } 
      /*for IE8 */
      input[type="submit"]:focus, input[type="button"]:focus {     
        outline : none; 
      }
    </style>
  </head>
  <body>
    <input type="button" value="Eureka!" />
  </body>
</html>

 

Done =)

Reference:

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.