select - CSS highlight/selection color based on page focus -


so, isn't absolute need, curious , might use @ point if exists...

i've developed site (not design) in areas of text have text-shadow, , noticed when said text highlighted, it's not legible. aware of , utilizing ::selection css selector along appropriate browser prefixes remove text-shadow on highlight.

my question whether there's anything can override highlighting defaults when text remains selected , focus removed page?

example: select-all , default (mozilla), selected text gets blue background. ... say, start messing firebug, or open smaller window on browser. highlights turn gray. can change behavior of blue ::selection property (color, background, text-shadow, etc.), gray's behavior remains unchanged. such thing exist?

yes can use selectors ::selection

for example try specific paragraph class gray

.gray p::-moz-selection { color: gold;  background: red; } .gray p::selection      { color: gold;  background: red; }  

or div class gray

.gray div::-moz-selection { color: gold;  background: red; } .gray div::selection      { color: gold;  background: red; }  

i not sure compatibility works me in ff, chrome , ie9


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -