0

That might not be a big deal for someones but i'm struggling with a little issue.

When i click several times on elements in my html, there are some blue selection rectangles that showing up.

I'm trying to find a way to get rid of that.

In my scss, i've tried

input, textarea, select, a, button { @include user-select(none) ; }

But i still get this issue mostly on text element.

So my question is : How to disable HTML blue selection when we make clicks on the links.

Any help will be appreciated.

Thanks.

John
  • 179
  • 1
  • 4
  • 13

2 Answers2

6

Try this:

::selection {
    background: transparent;
}
::-moz-selection {
    background: transparent;
}
  • Not sure the OP meant this, but its just what I was looking for. Don't know how many browsers it works on, but it seems good to go on Chrome and FF. browsers a few years back. – Randy Apr 12 '19 at 01:06
1

If you are talking about outlines so you can try below code

*{
outline-style: none;
}

or

*{
outline: none;
}

If you are talking about selection so use this code

 user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
Santosh Khalse
  • 12,002
  • 3
  • 36
  • 36
  • Something missing there? Drop that into a style block and it doesn't do anything, but does mess up all CSS after it. Does it need "::" in front of each? Should each property be {bracketed} ? – Randy Apr 12 '19 at 01:13