Daniel Williams
Daniel Williams

Reputation: 2317

Remove blue border appearing around element when clicked

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>

Upvotes: 5

Views: 7594

Answers (2)

Michael Benjamin
Michael Benjamin

Reputation: 371271

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

Upvotes: 12

Daniel Williams
Daniel Williams

Reputation: 2317

In your CSS put

table {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

Upvotes: 4

Related Questions