Remove full color from 'selection'

0

I put this code in my projects to eliminate the color when something is selected, but sometimes the "white spaces" that remain are colored with colors that should not be avoided or transparent, too?

::selection {
    background-color: transparent;
}

::-moz-selection {
    background-color: transparent;
}

::-webkit-selection {
    background-color: transparent;
}

Example:

    
asked by anonymous 30.06.2015 / 01:23

1 answer

1

You can disable user-select , try:

.noselect {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
<p class="noselect">
  Texto        com     espaços.          inclusive aqui >          
</p>
    
30.06.2015 / 01:26