他在ie下也能选中文字,但是选中其他列表,不会选中文字,原来它是在不同div中,属于不同的范围,而同事是放在同一个table中,当然会选中。

而在firefox下,文字不会被选中,查看google calender的css,原来还有-moz-user-select这个属性,很好玩!

最后采用一个了js方法,即onselectstart=function{return false;},不让页面进行选择,呵呵,这是很多网站不让复制采用的方法。

Summary

-moz-user-select is a Mozilla property extension to CSS that is used to determine whether or not an element may have its content selected.

Media: interactive

Possible uses include: prohibiting the selection of content in attempts to reduce blatant copying.

Syntax

TARGET_ELEMENT{-moz-user-select: none;}Legal Values

Value

Description

inherit

Inherit the value from the parent element.

none

None of the content may be selected.

text

Only the text within the element may be selected.

element

A single element may be selected (from many).

elements

Multiple elements may be selected.

all

The contents must either be selected in entirety or none at all.

toggle

The contents are selected "following a standard toggling content model" [1].

tri-state

unknown

-moz-all

unknown

Usage Examples

This sample code provides a simple "Hello, World!" text which prevents the user from selecting the content:

Hello, World!

Notes

This property is similar to the user-select property of CSS3.

When the 'none' value was applied to a heading element the content could still be selected.

According to the W3C, the "User agent's default style sheet may override this value. For example, user agents typically do not allow selection of the contents of a BUTTON element. [2] As the -moz-user-select was designed to mimic the user-select property, the same applies.

Specification Conformance

Doesn't conform to CSS standards; A Mozilla CSS Extension.

Browser Compatibility

Netscape 6+

Mozilla 0.6+

Firefox 1.0+

See Also

-moz-user-focus

-moz-user-input

-moz-user-modify

css中的 “-moz-user-select”和“-khtml-user-select”属性是什麽意思?以及它们的用法?

h1{

-moz-user-select:-moz-none;

}

这里在firefox中会显示不同

屏蔽选择的样式定义:-moz-user-select属性(只支持ff)。

属性有三个属性值:

1、 none:用none,子元素所有的文字都不能选择,包括input输入框中的文字也不能选择。

2、 -moz-all:子元素所有的文字都可以被选择,但是input输入框中的文字不可以被选择。

3、 -moz-none:子元素所有的文字都不能选择,但是input输入框中的文字除外。

IE浏览器下是通过 onselectstart=”javascript:return false;”事件来实现该功能。

-khtml-是苹果的那个浏览器的 好像现在使用-webkit-user-select: none

html入门moz a,css 让文字不被选中之-moz-user-select 属性介绍相关推荐

  1. CSS设置文字不能被选中

    设置文字不能被选中 以下为css样式 -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-selec ...

  2. css文字不被点击,css 让文字不被选中之-moz-user-select 属性介绍

    他在ie下也能选中文字,但是选中其他列表,不会选中文字,原来它是在不同div中,属于不同的范围,而同事是放在同一个table中,当然会选中. 而在firefox下,文字不会被选中,查看google c ...

  3. 前端入门: 用css设置文字样式。

    转自:微点阅读  https://www.weidianyuedu.com 经过前面的文章,相信大家已经基本了解了前端最基本的一些规则了: html搭建结构,承载内容 css则可以利用选择器,来为相应 ...

  4. css 文本不能被选中,【css】CSS设置文字不能被选中

    [Docker]Docker主机为什么ip nets 查不到网络空间 创建Docker容器后本来应该有新的命名空间(如果有独立网络的话),那么可以通过 ip netns 命令查看到命名空间,但是实际上 ...

  5. css html 字竖,CSS实现文字竖排 DIV CSS文字垂直竖列排版显示如何实现?

    DIV CSS实现文字竖排排版显示兼容各大浏览器,让文字垂直竖列排版布局. 有时我们需要一段文字进行从上到下竖列排版,我们知道CSS样式中有一样式可以让其竖列排版,但所有浏览器不全兼容,逼不得已放弃. ...

  6. div css将文字居中显示图片,css文字居中、图片居中、div居中解决方案

    一.文字居中 若文字只有一行 文本只有一行 .box { width: 200px; height: 200px; background-color: red; } .text { line-heig ...

  7. 从零入门 HTML、CSS、JS、React,构建 ToDo 待办事项管理项目!

    在今天,前端工程师已经成为研发体系中的重要岗位之一.可是与此相对的是,极少大学的计算机专业愿意开设前端课程,大部分前端工程师的知识,也都是在实践和工作中不断学习的. 最近收到很多同学的后台留言,说希望 ...

  8. 慕课学习史上最全零基础入门HTML5和CSS笔记

    慕课学习史上最全零基础入门HTML5和CSS笔记 Html和CSS的关系 学习web前端开发基础技术需要掌握:HTML.CSS.JavaScript语言.下面我们就来了解下这三门技术都是用来实现什么的 ...

  9. 简单入门HTML和CSS

    HTML和CSS 简单入门HTML和CSS HTML&CSS 网页的组成 HTML简介 HTML的语法 HTML的常用标签 HTML中的表格和表单 CSS的简单应用 简单入门HTML和CSS ...

最新文章

  1. 习题2-5 求平方根序列前N项和 (15 分)
  2. 如何为Oracle配置多个监听器
  3. jedis常用API
  4. mysql某个字段改为非unique
  5. Mybatis学习笔记18 - 缓存
  6. 680. 验证回文字符串 Ⅱ
  7. va_list/va_start/va_end的使用
  8. kangle支不支持PHP_【转载】PHP调用kangle的API
  9. win2K/win2003终端服务器超出最大允许连接数
  10. 【丁丁历险记】ESP8266/ESP32做微信遥控语音识别
  11. 英文单词搜索之词霸搜索
  12. word-wrap长单词与URL地址自动换行
  13. (Linux)进程间通信
  14. 【安全服务】应急响应1:流程、排查与分析
  15. Java in Tarena_Spring Note04
  16. Java空指针异常处理
  17. Fluent Bit的下载量达到10亿!
  18. linux服务脚本书写,编写一个服务脚本的示例
  19. 最新百度文库下载软件,还能下载源文件!
  20. 面向对象建模技术之设计模式——装饰​​​​​​​模式

热门文章

  1. 用友U8配置动态密码认证
  2. 原生CSS,实现点击按钮出现交互弹窗【新手扫盲】
  3. Redis的配置文件
  4. Ansible roles角色详解
  5. kafka可视化客户端工具(Kafka Tool)的基本使用
  6. 限流算法——漏桶算法和令牌桶算法介绍
  7. MySQL连接相关问题(查看及设置连接数)
  8. 性能测试(02)-HttpSampler
  9. IDEA 报错:找不到包或者找不到符号
  10. C++面向对象设计原则详解