Highlighting text - not background

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Highlighting text - not background

Post by Luke »

I've noticed on a few sites that when I highlight text, it doesn't invert the text-color and background color like it normally does. They have done something to make it just change the text color. This is some type of css I'm sure, but I couldn't find it.

For example: http://cakephp.org/

It doesn't work in IE either.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

For me when I clicked and dragged to highlight the text, I didn't get a highlight until I activated another window. I pasted it into a text file and could see that the page that was previously unhighlighted was now highlighted. (Firefox to PHPEdit) But now that I think of it, I wouldn't have been likely to figure it out if it weren't for my dual monitor set up.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

I saw a page, linked from digg (iirc) that explained how to do it, it's a firefox only thing though, I can't find the url, but i'll post back if i do...


<edit>

... That was quick...

http://www.quirksmode.org/css/selection.html

</edit>
Post Reply