Hacker News new | past | comments | ask | show | jobs | submit login

OT: How did they change the color of highlighted text? I've never seen that effect before!

Edit:

Found it in case someone else was interested:

    /* Mozilla based browsers */
    ::-moz-selection{background-color:#e12000;color:#fff;}
    /* Works in Safari */
    ::selection{background-color:#e12000;color:#fff;}



Keep in mind that many users highlight text as they read, so don't use some color that makes your text more unreadable.


Right. And also keep in mind that Firefox will change the selection color based on the inherent background color of the element being selected.

So, if you've got a black background of a super-parent element, and an light-colored image background for the parent or the element, your text will highlight white, ensuring that selected text is unreadable in certain situations.

Either the posted hack or setting a background color fixes it.


Seems like a much better solution would be to set a light-colored background color to the element which has the background image.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: