(WCAG defines large text as between 18.66px and 24px and bold, or 24px or. To meet current Web Content Accessibility Guidelines (WCAG), text content must have a contrast ratio of 4.5:1, or 3:1 for larger text such as headings. This is not a super important detail to any web design, but it adds a nice touch. Color contrast ratio is found by comparing the luminosity of the selected text and the selected text background colors.
#CSS FOR SELECTED TEXT COLOR HOW TO#
So here is a short one on how to change the color of your selection text (when you drag your cursor over text to copy, as you would on this website!) Normally this color is a blue, but it can be changed to match your design if you want. I have tried applying every combination of properties I can think of but have not hit on the correct one. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more. Incidentally, background-color also works on select box options - for colour selection menus I tend to change the background colour rather than the colour of the text as it stands out more. I have so many topics I want to cover, but very little time right now. The last line in the stylesheet was supposed to change the text in the selected item (the one with the white checkmark) to white, but it doesn't work.