How to change the font color and background color of selected text using only css
Websites having huge amount of contents and tutorials are often used for the references and usually bookmarked. Do you think upon delivering a unique gumption of feelings to your users who used your contents for their source of information’s? The best way is to change the background and the color of the selected text on the website.

You can easily change the background and the text color of the selected text using CSS properties defined below
::-moz-selection{
background:#cc3333;
color:#fff;
}
::selection {
background:#cc3333;
color:#fff;
}In case you want to implement this into your Wordpress blogs then you just need to open the Wordpress theme directory ( wp-content/themes/yourthemename/style.css) and the above CSS files into your style sheet.
Note:
- I used the red shade (#cc3333) because its my default color scheme, you may used the colors matched with your webpage.
- This method works like cream and is compatible with with Mozilla Firefox and Safari. This doesn’t work on Internet Explore.
- We defined<strong>::-moz-selection</strong>
for Mozilla Firefox whereas ::selection is used for default Safari browsers.
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackbackfrom your own site.
Subscribe to our FREE Rss FeedWhat's Hot
Similar Interesting Posts
- Agave-Professional Colour Scheme Designer
- How to change CSS for converting text to upper case, lower case, or to capitalize
- Download HoneytechBlog Christmas flavored wordpress theme
- How To Backup Your Browser’s Data
- How to decide the robots.txt for Wordpress blogs
- How to optimize website loading time and performance
- 20 Best Designs and Patterns
- 101 List Of Awesome Wordpress Tips and Resources
- Top 26 reasons to go for wordpress 2.6
- Official Gmail themes
- How to update your blog to wordpress 2.7
- Web Developer
- How to redirect wordpress.com blog to self hosted domain
- Skyfire – A free and fast mobile web browser
- How to add poll in your blog
Tutorials On









August 2nd, 2009 at 11:28 pm
Thanks for the Tip! I needed some CSS help desperately!
August 3rd, 2009 at 12:11 am
L’me know how can i help you ?