How to change the default text selection highlight color in wordpress

How to change default text highlight selection color in wordpressColors matters the most when it comes to web design. In order to catch and attract visitor’s eyes your site color and design should be outstanding as well as unique than others. One thing that comes by default and can be seen mostly on all sites is the text selection highlight color which is sky blue. Giving a little detail to the text selection highlight color by matching it to your theme will really attract your visitors. Here we will see how to change the default text selection highlight color in wordpress.

Some wordpress theme has the option to override this default text selection highlight color in order to match your theme. For those who don’t have this option you can change the default text selection color by adding a simple CSS trick.

Change default text selection highlight color in wordpress

Login to your wordpress dashboard and go to appearance >> editor and add the following CSS in stylesheet (style.css) and update file. If your theme supports custom CSS then add the following CSS in your theme custom CSS field. Save changes and now select a portion of text in your site and see the selected text highlight color.

/*** Works on common browsers ***/
::selection {
	background-color: #352e7e;
	color: #fff;
}

/*** Mozilla based browsers ***/
::-moz-selection {
	background-color: #352e7e;
	color: #fff;
}

/***For Other Browsers ***/
::-o-selection {
	background-color: #352e7e;
	color: #fff;
}

::-ms-selection {
	background-color: #352e7e;
	color: #fff;
}

/*** For Webkit ***/
::-webkit-selection {
	background-color: #352e7e;
	color: #fff;
}

How to change text selection highlight color in wordpress
Note: This CSS works on all browsers and never combine the above CSS in which you won’t see the results.

Using color codes

The above CSS has a color code that matches this site. Make sure you change the color codes to match you sites color scheme. Also make the selected text highlight color contrast so that the text looks clear and visitors don’t get confused. You can use eye dropper tool or colorpicker to grab your color codes.

Hope your wordpress site has got new look after changing the default text highlight color.