Here is rub:
:: selection {
background: # ffb7b7; / * WebKit / Blink Browsers /
}
:: - moz-selection {
background: # ffb7b7; / Gecko Browsers * /
} In the selection selector, color and background are the only properties that work. What you can do for some additional talent is changing the highlight color for different paragraphs or different sections of the page.
All I did was use a different highlight color for paragraphs with different classes:
p.red::selection {
background: # ffb7b7;
}
p.red::-moz-selection {
background: # ffb7b7;
}
p.blue::selection {
background: # a8d1ff;
}
p.blue::-moz-selection {
background: # a8d1ff;
}
p.yellow :: selection {
background: # fff2a8;
}
p.yellow :: - moz-selection {
background: # fff2a8;
} Note that selectors are not combined, although> a style block does the same. It does not work if you combine them:
<pre> p.yellow::selection, p.yellow::-moz-selection { background:
What, since the browser ignores the entire selector, if there is a part of it, they do not understand or are invalid. There are some exceptions to this (IE 7?), But not with respect to these selectors.
user8529958 Sep 07 '17 at 18:49 2017-09-07 18:49
source share