Ashley Sheridan​.co.uk

Change Selected Text Colours

Posted on

Tags:

It can be frustrating sometimes to design a website, only to have the operating systm of a visitor change a bunch of the colours it uses for everything. One annoying example is the text selection colours. Thankfully, CSS can help with this, thanks to its ::selection selector.

::selection {} background-color: #f00; color: #fff; } ::-moz-selection {} background-color: #f00; color: #fff; }

Try it on this page to see what the end result is.

Comments

Leave a comment