I need to change the background color of the selected text using codemirror. Can anyone help?
Add or change the background colorGo to Design > Page Color. Choose the color you want under Theme Colors or Standard Colors. If you don't see the color you want, select More Colors, and then choose a color from the Colors box.
When you select text in a webpage, the background gets a default blue color.
<FONT COLOR= > To change some of the text in the HTML document to another color use the FONT COLOR Tag. To change the color of the font to red add the following attribute to the code to the <FONT COLOR=" "> tag. #ff0000 is the color code for red.
The above answer is missing the essential !important
. You need:
.CodeMirror-selected {background-color: #CCCCCC !important;}
If you need to also change the selection foreground color, CodeMirror has the mark-selection.js
addon to achieve that.
Change the background color for .CodeMirror-selected {} , the class is located in codemirror.css
.CodeMirror-selected {background:#CCCCCC;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With