-1

I have a table, and in the first td I have a glyphicon:

<td><span class="glyphicon glyphicon-chevron-right"></span></td>

I added a onclick event on it, which will toggle the class, but when I do:

enter image description here

As you can see, I can accidentally "select" extra areas. That looks really bad.

Is there any suggestion on it?

j08691
  • 197,815
  • 30
  • 248
  • 265
daisy
  • 21,114
  • 28
  • 118
  • 236

2 Answers2

1

Just disable the user selection.

.glyphicon{
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
}
Lewis
  • 13,134
  • 12
  • 62
  • 81
1

Add this to your element, as seen in this answer:

.ClassName,
.ClassName:focus {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline-style:none;/*IE*/
}
Community
  • 1
  • 1
Tom Prats
  • 6,748
  • 7
  • 46
  • 76