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>

    靡不有初 鲜克有终
  • 相关阅读:
    冲刺 09
    冲刺08
    个人作业-买书
    冲刺07
    冲刺 06
    软件工程 寻找小水王
    冲刺04
    冲刺 03
    冲刺 02
    冲刺3
  • 原文地址:https://www.cnblogs.com/12606huchao/p/4849890.html
Copyright © 2011-2022 走看看