Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any idea on how to change textarea selection color?

I've tried this, but it won't work (in Chrome and IE) in case of textarea :(

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}
::selection {
  background: #b3d4fc;
  text-shadow: none;
}

Are there ary way to make it possible?
CSS or jQuery any how?

like image 975
john Avatar asked Jan 23 '26 15:01

john


1 Answers

This is only supported in Firefox (and Safari?).

You can do a workaround. Instead of textarea use div with contenteditable.

See: http://jsfiddle.net/VF4tb/1/

like image 114
bpoiss Avatar answered Jan 26 '26 08:01

bpoiss



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!