Results 1 to 2 of 2

Thread: [CSS or HTML]Change the color of the text selection

  1. #1

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Question [CSS or HTML]Change the color of the text selection

    Is there a way to change the color of the "text selection"? I am using red over black background when I select a text it turns grey. As the area around the selected text is black it is not seen. Can I change the color of that area?
    "Quis custodiet ipsos custodes?"
    Juvenal
    Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
    I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
    -=Joey Jordison R0CKS!! =-

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: [CSS or HTML]Change the color of the text selection

    Some browsers support a CSS construct for this. CSS 3 will include the selection pseudo-element, which you can use to style selected stuff. However, I think currently only Mozilla supports it, under the proprietary name of -moz-selection.
    Code:
    ::-moz-selection {
      background-color: green;
    }
    There is no cross-browser way to do this.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width