首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

设立选中文字的颜色和背景色

2012-10-31 
设置选中文字的颜色和背景色转载自:http://witmax.cn/css-text-selection.html样式:/*应用到全部标签*/* :

设置选中文字的颜色和背景色
转载自:http://witmax.cn/css-text-selection.html

样式:

/*应用到全部标签*/* ::-moz-selection{    background:#FFCC89 none repeat scroll 0 0;    color:#222222;}::selection{    background:#FFCC89 none repeat scroll 0 0;    color:#222222;}#someID ::-moz-selection{    background:#cc00cc none repeat scroll 0 0;    color:#fff;}#someID ::selection{    background:##cc00cc none repeat scroll 0 0;    color:#fff;}


说明:
   1. Firefox使用::-moz-selection私有选择符来实现,不支持::selection选择符
   2. Chrome、Safari、Opera均使用::selection选择符
   3. IE系列不支持选中文本样式
   4. 选中文本样式只支持文本颜色color和背景颜色background属性

热点排行