SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2008
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changing highlight color in html5

    How is this done? as an example, on this website when you highlight a word u see green

  2. #2
    SitePoint Guru bronze trophy TheRaptor's Avatar
    Join Date
    Jul 2011
    Location
    New York
    Posts
    710
    Mentioned
    40 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by enwise View Post
    How is this done? as an example, on this website when you highlight a word u see green
    This can be achieved with this bit of code:
    Code:
    ::selection { background: #fff; color: #000; } /* Safari 3.1+, Opera 9.5+, Chrome 2+ */
    ::-moz-selection { background: #fff; color: #000; } /* Mozilla Firefox */
    Keep in mind the support for this is slim (see css comments), but its a cool feature for those browsers that do support it.

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2008
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TheRaptor View Post
    This can be achieved with this bit of code:
    Code:
    ::selection { background: #fff; color: #000; } /* Safari 3.1+, Opera 9.5+, Chrome 2+ */
    ::-moz-selection { background: #fff; color: #000; } /* Mozilla Firefox */
    Keep in mind the support for this is slim (see css comments), but its a cool feature for those browsers that do support it.
    thanks


Bookmarks

Posting Permissions

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