2

So I wanted to style selection on my Tumblr blog differently, and it works great in Mozilla, but when it comes to Chrome when I put this code:

::selection {
    background:{color:Body Text};
    color:{color:Entry Background};
}

::-moz-selection {
    background:{color:Body Text};
    color:{color:Entry Background};
}

::-webkit-selection {
    background:{color:Body Text};
    color:{color:Entry Background};
}

colors aren't right.

Test here - try both Mozilla and Chrome and you'll see what I'm talking about.

I also wanted to see if maybe the problem was in using Tumblr color codes [{color:Body Text}] but the same thing happens if I use regular color codes [#555555].

There is also this demo where ::selection works perfectly in Chrome, even without that annoying additional blue selection part.

Is there a way to get rid of that blue selection part?

Or any solutions for the whole issue?

Here's a screenshot of what the question is asking:

screenshot

Kobi Tate
  • 373
  • 3
  • 18
MSmS
  • 189
  • 1
  • 4
  • 15
  • Could you please post a screenshot and describe *exactly* what the problem is? (Maybe we don't see what you're talking about; maybe it's just your computer. `:)`) – Ry- Oct 15 '12 at 22:55
  • There is no `::-webkit-selection`. Also, possible duplicate of http://stackoverflow.com/questions/12650767/the-remaining-blue-color-in-selection – BoltClock Oct 16 '12 at 02:18
  • 1
    Please see: http://stackoverflow.com/a/8866876/900747 – A.M.K Oct 16 '12 at 02:24
  • Possible Duplicate: http://stackoverflow.com/q/8866866/900747 – A.M.K Oct 16 '12 at 02:25
  • It's not a duplicate of anything, none of those issues are referring to Chrome making colors different than written, and blue section question wasn't the main problem. – MSmS Oct 16 '12 at 10:06
  • I would guess it has to do with the
    tags You can find more info [here][1]. Could you test adding
    tags to your test code? [1]: http://stackoverflow.com/questions/899252/can-you-target-br-with-css
    – JimmyRare Oct 16 '12 at 10:24
  • I asked a similar question some time ago: http://stackoverflow.com/questions/12650767/the-remaining-blue-color-in-selection According to Jared Farrish, the problem seems to happen "when an element is nested within another element which itself has selectable elements." – deathlock Oct 18 '12 at 10:02

0 Answers0