selected text background color

前端 未结 2 1721
臣服心动
臣服心动 2021-02-06 17:05

when i use any site i see that selected text background color show blue or according our OS theme.can i change this selected text background color?

相关标签:
2条回答
  • 2021-02-06 17:55

    In Firefox, you can apply CSS styles to ::-moz-selection.
    In Safari, you can apply CSS styles to ::selection.

    See here.

    0 讨论(0)
  • 2021-02-06 17:56

    You can use this style. this will work on all major browser except IE

    <style>
                 ::-moz-selection
                {
                 background:#0C0;
                 color:#f00;
                 }
                ::selection
                {
                background:#6374AB;
                color:#F00;
               }
        </style>
    
    0 讨论(0)
提交回复
热议问题