css3 mix-blend-mode 还能用么

html-css017

css3 mix-blend-mode 还能用么,第1张

可以看到CSS3 mix-blend-mode chrome firefox 支持良好,都不用私有前缀

mix-blend-mode: normal          //正常

mix-blend-mode: multiply        //正片叠底

mix-blend-mode: screen          //滤色

mix-blend-mode: overlay         //叠加

mix-blend-mode: darken          //变暗

mix-blend-mode: lighten         //变亮

mix-blend-mode: color-dodge     //颜色减淡

mix-blend-mode: color-burn      //颜色加深

mix-blend-mode: hard-light      //强光

mix-blend-mode: soft-light      //柔光

mix-blend-mode: difference      //差值

mix-blend-mode: exclusion       //排除

mix-blend-mode: hue             //色相

mix-blend-mode: saturation      //饱和度

mix-blend-mode: color           //颜色

mix-blend-mode: luminosity      //亮度

mix-blend-mode: initial         //初始

mix-blend-mode: inherit         //继承

mix-blend-mode: unset           //复原

div.trans { width:100pxheight:100pxbackground:graytransition:width 2s-moz-transition:width 2s/* Firefox 4 */ -webkit-transition:width 2s/* Safari and Chrome */ -o-transition:width 2s/* Opera */ } div.trans:hover { width:300px} div.ani { width:100pxheight:100pxbackground:redposition:relativeanimation:mymove 5s infinite-moz-animation:mymove 5s infinite/*Firefox*/ -webkit-animation:mymove 5s infinite/*Safari and Chrome*/ } @keyframes mymove { from {left:0px} to {left:200px} } @-moz-keyframes mymove /*Firefox*/ { from {left:0px} to {left:200px} } @-webkit-keyframes mymove /*Safari and Chrome*/ { from {left:0px} to {left:200px} }刚开始W3C CSS Workgroup拒绝将CSS3 transition与animation加入官方标准,一些成员认为过渡效果和动画并非样式属性,而且已经可以用脚本实现。语法:transition: property duration timing-function delay说明:ValueDescriptiontransition-property指定要改变CSS属性的名称transition-duration指定过渡效果要花多少时间(s/ms)transition-timing-function指定过渡效果的速度transition-delay定义过渡效果的延迟时间.实例:<style type="text/css">div { width:100pxheight:100pxbackground:redtransition:width 2s-moz-transition:width 2s/* Firefox 4 */ -webkit-transition:width 2s/* Safari and Chrome */ -o-transition:width 2s/* Opera */ } div:hover { width:300px} </style><div></div>2. AnimationCSS动画(Animations)简单说就是在一段固定的动画时间内暗中在某一频率内改变其CSS某个或某些值,从而达到视觉上的转换动画效果。下面看下一个简单的实例:<style type="text/css">div { width:100pxheight:100pxbackground:redposition:relativeanimation:mymove 5s infinite-moz-animation:mymove 5s infinite/*Firefox*/ -webkit-animation:mymove 5s infinite/*Safari and Chrome*/ } @keyframes mymove { from {left:0px} to {left:200px} } @-moz-keyframes mymove /*Firefox*/ { from {left:0px} to {left:200px} }@-webkit-keyframes mymove /*Safari and Chrome*/ { from {left:0px} to {left:200px} } </style><div></div>语法:animation: name duration timing-function delay iteration-count direction说明:ValueDescriptionanimation-name指定动画帧的名称animation-duration指定动画运行的时间:秒(s)和毫秒(ms)animation-timing-function指定动画运行的速度animation-delay指定动画的延迟时间animation-iteration-count指定动画的重复数animation-direction指定动画是否以相反的方向运行动画