1

I can't make that code unselectable. How can I change it?

I tried placing user-select: none in all of css classes, but it's still selectable.

<div class="outer">
    <a href="/">
        <img src="/wp-content/themes/theme/assets/img/logo.png">  
    </a>
</div>
TylerH
  • 20,799
  • 66
  • 75
  • 101
kilofeq
  • 17
  • 4

2 Answers2

0

user-select is not supported in all browsers without prefix. Try this:

.outer {
  user-select: none;
  -webkit-user-select: none; /* Safari 3.1+ */
  -moz-user-select: none; /* Firefox 2+ */
  -ms-user-select: none; /* IE 10+ */
}
-2

This was answered here, I can't post it in chat yet, sorry: How to make HTML Text unselectable

Long story short:

.outer {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}