-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
  • 204,283
  • 31
  • 260
  • 272
daisy
  • 22,498
  • 29
  • 129
  • 265

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
  • 14,132
  • 12
  • 66
  • 87
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
  • 7,364
  • 9
  • 47
  • 77