Viewing 5 replies - 1 through 5 (of 5 total)
  • Add this to your actual theme’s functions.php file:

    function add_my_custom_css() {
    	?>
    		<style type="text/css" media="all">
    			::-moz-selection { /* Code for Firefox */
    			    color: inherit;
    			    background: #FDDAAA!important;
    			}
    
    			::selection {
    			    color: inherit;
    			    background: #FDDAAA!important;
    			}
    		</style>
    	<?php
    }
    add_action('wp_head', 'add_my_custom_css');
    Thread Starter exhale68

    (@exhale68)

    Where exactly do I add it in? At the very bottom at the end? And what does that do exactly? What Color will the highlighted text become after adding it?

    Where exactly do I add it in? At the very bottom at the end? And what does that do exactly? What Color will the highlighted text become after adding it?

    It will do as in the screenshot.. To avoid any PHP syntax errors at the functions file I suggest using this plugin:

    simple custom CSS

    Use it to add:

    ::-moz-selection { /* Code for Firefox */
        color: inherit;
        background: #FDDAAA!important;
    }
    
    ::selection {
        color: inherit;
        background: #FDDAAA!important;
    }
    Thread Starter exhale68

    (@exhale68)

    So all I have to do is take the code you gave me in the first comment and add it anywhere in the functions.php file?

    Yes, I think its been very clear. For many reasons I suggest following my second suggestion, using the plugin I linked to add that custom CSS.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How can i change my site's highlighting text color?’ is closed to new replies.