css3实现的文本无法选中效果:
在实际应用中可能有这样的需求,那就是设置指定元素中的文本不可以选中。
css3中指定属性可以实现此功能,下面就通过代码实例介绍一下如何实现此功能。
代码如下:
<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css"> div{ -moz-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -o-user-select:none; -ms-user-select:none; user-select:none; background:#CCC; font-size:12px; text-align:center; width:300px; height:150px;} </style> </head> <body> <div>蚂蚁部落欢迎您</div></body> </html>
原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=15482
更多内容可以参阅:http://www.softwhy.com/divcss/
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号