Code Snippet
Change Text Selection Color
/* Mozilla based browsers */
::-moz-selection {
background-color: #FFA;
color: #000;
}
/* Works in Safari */
::selection {
background-color: #FFA;
color: #000;
}
/* Mozilla based browsers */
::-moz-selection {
background-color: #FFA;
color: #000;
}
/* Works in Safari */
::selection {
background-color: #FFA;
color: #000;
}
I think these snippets are a great idea, but they need better descriptions, what does the script do, provide a working example of it above the code..
This entire website, at the time of this writing anyway, is an example of the above.
“provide a working example of it above the code..” is it not enough that he provides all these snippets? LoL, just kidding, I love the work that you do Chris, but I do agree with andrew. It would be helpful to see working examples, but I don’t think we can ask more of you. Love the site, keep it up.
Select any text on this site. Notice the selection colour is not blue. :P
Cool tip, but is there any way to get this effect to work on the focus highlight of a select or input element?
If Chris were to be any more thorough it would be condescending, I appreciate not being treated like an asshole. Cheers!
is there any way which will work in internet explorer also???
Hi Chris, your a jedi!!!!!!!!!!
all the links on this page are snazzy!!!! I’m using the alpha theme and for the life of me can’t change the look of links!!!!! please please i’m begging you show me how to have links like yours please please i’ve tried putting all sorts of css into the custom css area nothing happens to my links…..
I’m thinking there’s something more to just adding the correct code into css area? i’ve tried everything my links still have a line and horrible background colour when hovered….frustrating OMG….is it the alpha theme in RW 4.4.2 maybe?
Hey there…
I was just wondering that this is CSS3 and we know that CSS3 doesnt work in the current versions of IE… is there any alternate in CSS that we can create so that our website looks same in IE as well?
Of course another solution would be to use bg’s but appart from that???
e.g. try this website in IE6.
You know what i mean?
Have a look to
http://css3pie.com.. This will make some of the css3 features work in IE.. I succeeded just partially to make it work ob my site..Also
http://modernizr.comoffers some other useful features and fallback support for old browsers.Hope it helps
Please check http://dowebsitesneedtolookexactlythesameineverybrowser.com/
That’s great! :-D
How can you change the selection color for an image?
What about in ie?
How can i change selection background color in ie.
Hi Chris,
I’m interested as to why you’ve not included a ::selection colour in v.9 when it was used in v.8. Have your thoughts on its use changed?
Great Trick.. Really useful…. tanx :)
Thanks!
It seems like that is the same color as my default browser so I felt like a fool for not seeing a change, but when I pasted it into a CSS file and played with the colors, it worked perfectly.
Great css Tricks but the live example is missing, provide a working example of the code..
I think it would work fine, you need to put the text in a div right? Thanks for the post!
Could you please show us, how text change after some time(1 minutes etc), if we have 5 text paragraph we want to display these one by one
please help me to do so
Also for webkit…
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.