February 5, 2008
4:57 pm

Try selecting the innocent-looking text over at this page using Firefox.

Spoiler: What happens is that you can see the word "Google" appear. This hack utilizes the CSS3 "selection" pseudo-element. Each portion of letters in the HTML receives its own class, like <span class='color-51'>foo</span>. A tool to create your own selectable text this way is available, too. Stylesheet definitions like the following handle the rest:

.color-51::selection { color: rgb(79, 106, 115); background: rgb(79, 106, 115) } .color-51::-moz-selection { color: rgb(79, 106, 115); background: rgb(79, 106, 115) }

Source:? Google Blogoscoped

CSS, CSS3, Spoiler

Loading

Contextual Related Posts:

No followup yet

Leave a Response

Comment Preview
« Google adds Postini Security Products to Google AppsYahoo! launches Zimbra Collaboration Suite 5.0 with BlackBerry and Outlook 2007 support »
Feed Icon

Subscribe via RSS or email: