Giter VIP home page Giter VIP logo

css-abc's People

Watchers

James Cloos avatar solocao avatar

css-abc's Issues

禁止元素选中、拖拽div等元素

解决方法就是让鼠标事件失效,需要用到一个css属性。pointer-events

pointer-events:auto | none | visiblepainted | visiblefill | visiblestroke | visible | painted | fill | stroke | all

默认值:auto

适用于:所有元素

继承性:有

动画性:否

计算值:指定值

取值:

  • auto:

    与pointer-events属性未指定时的表现效果相同。在svg内容上与visiblepainted值相同

  • none:

    元素永远不会成为鼠标事件的target。但是,当其后代元素的pointer-events属性指定其他值时,鼠标事件可以指向后代元素,在这种情况下,鼠标事件将在捕获或冒泡阶触发父元素的事件侦听器。

  • 其他值只能应用在SVG上。

说明:

设置或检索在何时成为属性事件的target。

  • 使用pointer-events来阻止元素成为鼠标事件目标不一定意味着元素上的事件侦听器永不会触发。如果元素后代明确指定了pointer-events属性并允许其成为鼠标事件的目标,那么指向该元素的任何事件在事件传播过程中都将通过父元素,并以适当的方式触发其上的事件侦听器。当然位于屏幕上在父元素上但不在后代元素上的鼠标活动都不会被父元素和后代元素捕获(将会穿过父元素而指向位于其下面的元素)。
  • 对应的脚本特性为pointerEvents

关于安全字体

常用的字体组合

font-family属性是多种字体的名称,作为一个"应变"制度,以确保浏览器/操作系统之间的最大兼容性。如果浏览器不支持的第一个字体,它尝试下一个的字体。
你想要的字体类型如果浏览器找不到,它会从通用的字体类型中找到与你相似的:

http://zenozeng.github.io/fonts.css/

三种样式比较

这几种插入方式的效果是相同的,但是其优缺点却不一样。应当依据使用要求而选择不同的插入方法。比如,外部样式单的优点在于可以统一整个网站的所有网页的样式,只要改动一个外部样式单文件,站点内所有的引用了该样式单相应样式的页面便都进行了改动,也方便了站点的维护。而嵌入式样式单的作用在于统一整个页面的样式,只需要改动某一个样式定义,整个页面内的所有文件的相应位置均会改变,有利于统一页面内部的样式。内联式样式单的作用在于简化了HTML标记的属性,直接通过CSS控制显示样式,使页面效果更加丰富多彩。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.