-1

I want to disable or transparent the selection color when I click the mouse to select all web page

I use CSS ::selection , like below css

*::selection
{
  -webkit-appearance: none;
  outline: none;
}

But when you go to the lowermost part of the page, and select to the top, <p> and <img> cannot be selected, - this is correct, but to the right of all images "space" still appear in selection color! How can I disable or make transparent all images side selection color ? (I don't want selection background-color to white ,need transparent)

DEMO

mplungjan
  • 169,008
  • 28
  • 173
  • 236
  • Welcome to SO. Please use the markdown explained [here](http://stackoverflow.com/help/formatting) and have a read of the rest of the [help] – mplungjan Jul 30 '15 at 07:20
  • there is a great jQ solution [here](http://stackoverflow.com/a/9256483/1305910) – RozzA Sep 16 '15 at 23:58

2 Answers2

0

Wrap the IMG tags in a tag like <p> too and the colour disappears

 <p> dnksdnsdnjvf ffm in ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn ifn fi nfijvdjfvv fv fnj vfjv fjv fjv fjnvfj jnf fj </p>
 <p><img src="http://thumb1.shutterstock.com/thumb_small/260389/212829874/stock-photo-green-tea-in-wooden-spoon-and-lemon-slice-212829874.jpg"></p>
mplungjan
  • 169,008
  • 28
  • 173
  • 236
0

You can try something like this

::selection {
  background-color: rgba(0, 0, 0, 0.5);
}
body {
  background-image: url(http://www.homelogy.net/wp-content/uploads/2015/04/linen-1.jpg);
}
select this text

click on Run Code Snippet and select the text


you can replace the 0s with the rgb value. the last value, alpha, is the transparency, 1 = solid | 0 = transparent

rgba stands for red-green-blue-alpha. You can search online for a hex to rgb converter to convert the #00bbaa colors to something like 200, 500, 300.