zoukankan      html  css  js  c++  java
  • css3控制内容的可选择性

    <!doctype html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="Author" content="胡超">
    <title>super胡</title>
    <style>
    div{
    text-align:center;
    height:39px;
    -moz-user-select:none;
    -o-user-select:none;
    -webkit-user-select:none;
    -ms-user-select:none;
    user-select:none;
    /*IE6-9不支持该属性,但支持使用标签属性 onselectstart="return false;" 来达到 user-select:none 的效果;Safari和Chrome也支持该标签属性;
    直到Opera12.5仍然不支持该属性,但和IE6-9一样,也支持使用私有的标签属性 unselectable="on" 来达到 user-select:none 的效果;unselectable 的另一个值是 off;
    除Chrome和Safari外,在其它浏览器中,如果将文本设置为 -ms-user-select:none;,则用户将无法在该文本块中开始选择文本。不过,如果用户在页面的其他区域开始选择文本,则用户仍然可以继续选择将文本设置为 -ms-user-select:none; 的区域文本;*/
    }
    </style>

    </head>
    <body>
    <div onselectstart="return false;" unselectable="on">
    找不到
    </div>
    </body>
    </html>

    靡不有初 鲜克有终
  • 相关阅读:
    vector的erase函数
    结构体定义容易混淆的地方
    JavaScript重点知识
    JS中预解析案例分析
    浏览器console控制台不显示编译错误/警告
    强烈推荐一款强大的公式编辑器软件AxMath
    DIV+CSS布局
    CSS-常见属性
    CSS-定义样式表
    CSS-使用CSS样式的方式
  • 原文地址:https://www.cnblogs.com/12606huchao/p/4849890.html
Copyright © 2011-2022 走看看