原来Chrome支持::selection样式表设置

Posted on September 28, 2008 by Fdream

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

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

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

分享 |
Categories:
Ajax Web
Tags:
, ,
Comments:
Leave a comment
Views:
1,536 Views

Related Posts

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>