0

When you highlight a set of words on the Internet, the default background color would be sky blue and the default font color would be white. Is there a way to change these colors using HTML or CSS?

  • 1
    Does this answer your question? [Changing the text selection color using CSS?](https://stackoverflow.com/questions/10578073/changing-the-text-selection-color-using-css) – Nikolay Shebanov Jan 24 '21 at 12:08

1 Answers1

2

Use the ::selection selector to override the default text selection color:

::selection {
  color: red;
  background: black;
}

notnotparas
  • 177
  • 1
  • 11