这个是用来设置被选择文字的背景色和文字颜色(就是文字高亮时的样子),例如:

Chrome支持::selection,Firefox是支持::-moz-selection,IE就啥都不支持了,不过这两个样式要分开写,像这样:

::selection{
    color:#f0d000;
    background-color:#0f581a;
}
::-moz-selection{
    color:#f0d000;
    background-color:#0f581a;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.