如何改变在浏览器上选中字体的颜色

<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>CSS如何设置选中文本的颜色</title>
<style type="text/css">
::selection{
  background-color:#84ca7f;
  color:#000;
}
::-webkit-selection{
  background-color:#84ca7f;
  color:#000;
}
::-moz-selection{
  background-color:#84ca7f;
  color:#000;
}
</style>
</head>
<body>
<div>选中该段文字,文本颜色变化</div>
</body>
</html>

posted @ 2015-12-28 11:08  sure2016  阅读(1301)  评论(0编辑  收藏  举报