div::-moz-selection{background:#93C;color: #fff;}
div::selection {background:#93C; color:#fff;}
说明:
1、-moz-属性前缀是个火狐浏览器用的,而基本的::selection选择器是给谷歌浏览器用的。
2、background后面可以直接使用颜色值。如:::selection { background:#ffff00; }
另外:
跟其它CSS选择器的用法一样,也可以嵌套使用,在不同的地方显示不同的颜色。
如下:
/ webkit, opera, IE9 /
div::selection { background:lightblue; }
/ mozilla firefox /
div::-moz-selection { background:lightblue; }
/ webkit, opera, IE9 /
div::selection { background:pink; }
/ mozilla firefox /
div::-moz-selection { background:pink; }
文章评论
I am extremely impressed with your writing talents and also with the structure for your weblog.
Is this a paid theme or did you modify it your self?
Either way stay up the excellent quality writing, it's uncommon to see a great
blog like this one nowadays..
@CBD oil for anxiety Thank you for your support to Dongtai blog, but please don't advertise. Thank you