Determine browser's default text highlight color using JavaScript or Dart

前端 未结 2 1730
生来不讨喜
生来不讨喜 2021-01-18 07:51

The browser\'s default text highlight (selection) background color can be overridden, e.g.:

::selection {
  background: #ffb7b7;
}

And the

2条回答
  •  北海茫月
    2021-01-18 08:33

    As described at https://stackoverflow.com/a/39543711/3273929, you can use CSS system colors: https://www.w3.org/TR/2010/PR-css3-color-20101028/#css2-system, although they are deprecated, they do work.

提交回复
热议问题