Generally on the Web page, when the text is selected, the style of the text will change, of course, the style is the same as the default style of the browser, blue-white, occasionally see some pages above when the text is selected when there will be a different style, then very curious, then slowly discovered is a pseudo-class CSS:: Selection
:: Selection is a CSS3 selector (this also tells us that we CSS3 have to be familiar with, this thing can really make a lot of unexpected good results.) )
Compatibility: Ie9+,chrome,opera,safari,firefox ... (can also go to view) caniuse.com#search=::selection
Of course, Firefox has to add-moz-prefixes to get its effect.
1 :: Selection {2 background-color: Navy; 3 color: red; 4 }5::-moz-selection{6 background-color: Navy; 7 color: red; 8 }
You can select the following text to try it out:
Select I select I select i check i select I select I select I select I select i check i select I select I
CSS3 Special Pseudo-Class:: Selection change the style of the selected text on the page