Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove blue border appearing around element when clicked

Tags:

html

css

I'm using Firefox on Mac OS. When I CMND+CLICK the text in the table a blue border appears around the TD. Am I able to tell CSS to not show this border on click/focus?

<table>
  <tr>
    <td>Hello World!</td>
  </tr>
</table>
like image 892
Daniel Williams Avatar asked Aug 09 '16 00:08

Daniel Williams


2 Answers

You're likely encountering the outline. Try this:

td { outline: none; }  /* value "0" also works */

https://developer.mozilla.org/en-US/docs/Web/CSS/outline

like image 145
Michael Benjamin Avatar answered Sep 16 '22 13:09

Michael Benjamin


In your CSS put

table {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
like image 27
Daniel Williams Avatar answered Sep 18 '22 13:09

Daniel Williams