selection color

edited May 2008 in userstyles.org
I'm confused about how the selection color is set. Example - if you select something on this page the background is blue - the normal setting.

But some sites annoyingly reset the selection color. Example
A plan for Iran - - Breaking News, Political News & National Security News - The Washington Times
http://washingtontimes.com/article/20080514/EDITORIAL09/755955313/1013/EDITORIAL
The text color is blue if selected - the background doesn't change.

How can I control the selection color with !important ???

Comments

  • div{background-color:red!important}
  • Umm... I meant...

    image

    google is a well behaved site and the selected text has the "default" background blue. washingtontimes.com is not well behaved and changes the font color when text is selected.

    1
    What's a global style to force all sites to select text with the "default" background blue and leave the font color alone?

    2
    What's a style I can use just at washingtontimes.com ?

    3
    What's the hex number of that blue?
  • edited May 2008
    1
    What's a global style to force all sites to select text with the "default" background blue and leave the font color alone?
    Global:
    @namespace html url(http://www.w3.org/1999/xhtml);
    ::-moz-selection {
    background: navy !important;
    }

    2
    What's a style I can use just at washingtontimes.com ?
    Site specific:
    @namespace html url(http://www.w3.org/1999/xhtml);
    @-moz-document domain(washingtontimes.com) {
    ::-moz-selection {
    background: black !important;
    color: white !important;
    }
    }

    3
    What's the hex number of that blue?
    (#000080 or navy)
    Default combination: { background: navy !important; color: white !important; } Change colors to what ever you like.

    Can also specify other colors to identify specific elements when selecting an entire paragraph.
    Example:
    ::-moz-selection {
    background: navy !important;
    color: white !important;
    }
    a::-moz-selection {
    background: green !important;
    color: white !important;
    }
    a:link::-moz-selection {
    background: red !important;
    color: white !important;
    }
  • srazzano thanks - but the code seems not to work.

    = navy and #000080 aren't the default - as in the image of selected google text. They make the selected text darker, in a word: navy.

    =
    I checked kb.mozillazine.org
    Your search - "-moz-selection" - did not match any documents.
    I goolged mozilla - and only got one hit
    1 from mozilla.org for "-moz-selection"

    I'm confused.
  • edited May 2008
    I'm using FF3.0 RC1 and experiencing no problems with the code. What browser version are you using? Also this may sound like a dumb question but are you putting the code in userContent.css vise userChrome.css?
  • I'm using ff 2.0.0.14

    I wasn't using userContent.css or userChrome.css I put it in a style.
  • edited May 2008
    Then possibly the code is being over ridden. Try putting the code in userContent.css and maybe try ::selection vise ::-moz-selection

    Also try using: body { float: left !important; } on VOA News
Sign In or Register to comment.