当前第2页 返回上一页
代码示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <!DOCTYPE html>
< html >
< head >
< meta charset = "UTF-8" >
< style type = "text/css" >
p {
border: 1px solid red;
}
.color::-moz-selection {
background: #93c;
color: #fcf;
}
.color::selection {
background: #93c;
color: #fcf;
}
</ style >
</ head >
< body >
< p >默认文本。测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!</ p >
< p class = "color" >鼠标选中文字后改变背景色。测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!测试文本!</ p >
</ body >
</ html >
|
效果图:
更多编程相关知识,请访问:编程教学!!
以上就是css怎么实现鼠标选中文字后改变背景色的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
使用css怎么实现毛玻璃效果?
css定位有哪些
css max-width属性怎么用
10个令人惊叹的非典型css套件
不能忘却的悼念:将网页背景变为黑白色调教程
“margin:0 atuo;” 是什么意思?
css段落间距怎么设置
纯css实现加号“+”效果(代码示例)
p的css初始属性是什么
为什么要用div+css布局
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css怎么实现鼠标选中文字后改变背景色