Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to Change the Color of Selected Content

How to Change the Color of Selected Content

Problem

Can anyone tell me how to change the Color of the selected content?? em using this css for it

::selection {
        background: #ffb7b7; /* Safari */
        }
::-moz-selection {
        background: #ffb7b7; /* Firefox */
}

It works good but not what I want, it change the color of selected text but the spaces/gaps are not select, spaces/gaps are select with the default blue color, any remedy for it?? Check my Blog and try to select the spaces/gaps then u know exactly whats wrong with it.. Waiting for ur help :) http://kownleg.blogspot.com

Problem courtesy of: RJ Style

Solution

There are some areas that are highlighted in the darker blue colour, but I don't think there's much you can do about that if I'm being honest.

It actually looks like the ::selection pseudo element is supported experimentally by only a few browsers, and it doesn't look like it will be added to any others any time soon. See this link for more info

Solution courtesy of: Mat Richardson

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

How to Change the Color of Selected Content

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×