博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
css3
阅读量:6991 次
发布时间:2019-06-27

本文共 3690 字,大约阅读时间需要 12 分钟。

一.转换transform

1.谷歌和Safari需要前缀-webkit-,IE9需要前缀-ms-。

2.2D转换方法:translate(),rotate(),scale(),skew(),matrix()

div{transform: rotate(30deg);-ms-transform: rotate(30deg);		/* IE 9 */-webkit-transform: rotate(30deg);	/* Safari and Chrome */-o-transform: rotate(30deg);		/* Opera */-moz-transform: rotate(30deg);		/* Firefox */}

3.3D转换方法:rotateX(),rotateY().

支持浏览器有:IE10,火狐,谷歌和Safari需要前缀-webkit-,欧朋不支持3D属性。

二.过渡transition

1.支持浏览器:IE10,火狐,谷歌,欧朋

2.transition

div{transition: width 2s, height 2s, transform 2s;-moz-transition: width 2s, height 2s, -moz-transform 2s;-webkit-transition: width 2s, height 2s, -webkit-transform 2s;-o-transition: width 2s, height 2s,-o-transform 2s;}

3.属性:

transition-duration:过渡效果花费时间

transition-timing-function:过渡效果时间曲线

transition-delay:规定过渡效果何时开始

三.动画@keyframes

1.支持浏览器:IE10,火狐,欧朋,谷歌和Safari

2.用法

//把 "myfirst" 动画捆绑到 div 元素,时长:5 秒:

div{animation: myfirst 5s;-moz-animation: myfirst 5s;	/* Firefox */-webkit-animation: myfirst 5s;	/* Safari 和 Chrome */-o-animation: myfirst 5s;	/* Opera */}

@keyframes myfirst

{
from {background:red;}
to {background:yellow;}
}

@-moz-keyframes myfirst /* Firefox */

{
from {background:red;}
to {background:yellow;}
}

@-webkit-keyframes myfirst /* Safari and Chrome */

{
from {background:red;}
to {background:yellow;}
}

@-o-keyframes myfirst /* Opera */

{
from {background:red;}
to {background:yellow;}
}

或者用百分比
@keyframes myfirst{0%   {background: red;}25%  {background: yellow;}50%  {background: blue;}100% {background: green;}}@-moz-keyframes myfirst /* Firefox */{0%   {background: red;}25%  {background: yellow;}50%  {background: blue;}100% {background: green;}}@-webkit-keyframes myfirst /* Safari 和 Chrome */{0%   {background: red;}25%  {background: yellow;}50%  {background: blue;}100% {background: green;}}@-o-keyframes myfirst /* Opera */{0%   {background: red;}25%  {background: yellow;}50%  {background: blue;}100% {background: green;}}

 3.属性:

(1)@keyframes:规定动画

(2)animation:动画属性简写,除了animation-play-state

(3)animation-name:动画名称

(4)animation-duration:动画一个周期花费时间层

(5)animation-timing-function:动画速度曲线

(6)animation-delay:动画延迟时间

(7)animation-iteration-count:播放次数

(8)animation-direction:动画是否在下一周期逆向播放

(9)animation-play-state:规定是都正在运行或暂停

(10)animation-fill-mode:规定动画时间之外的状态

div{animation-name: myfirst;animation-duration: 5s;animation-timing-function: linear;animation-delay: 2s;animation-iteration-count: infinite;animation-direction: alternate;animation-play-state: running;/* Firefox: */-moz-animation-name: myfirst;-moz-animation-duration: 5s;-moz-animation-timing-function: linear;-moz-animation-delay: 2s;-moz-animation-iteration-count: infinite;-moz-animation-direction: alternate;-moz-animation-play-state: running;/* Safari 和 Chrome: */-webkit-animation-name: myfirst;-webkit-animation-duration: 5s;-webkit-animation-timing-function: linear;-webkit-animation-delay: 2s;-webkit-animation-iteration-count: infinite;-webkit-animation-direction: alternate;-webkit-animation-play-state: running;/* Opera: */-o-animation-name: myfirst;-o-animation-duration: 5s;-o-animation-timing-function: linear;-o-animation-delay: 2s;-o-animation-iteration-count: infinite;-o-animation-direction: alternate;-o-animation-play-state: running;}

 四.用户界面

1.resize

(1)支持浏览器:火狐,谷歌,safari

(2)

div{resize:both;overflow:auto;}

2.box-sizing

(1)支持浏览器:IE,谷歌,safari,欧朋,火狐需要前缀-moz-。

(2)作用:允许以确切方式定义适应某个区域的具体内容。

(3)

div{box-sizing:border-box;-moz-box-sizing:border-box;	/* Firefox */-webkit-box-sizing:border-box;	/* Safari */width:50%;float:left;}

3.outline-offset

(1)除了IE都支持

(2)对轮廓进行偏移,并在超出边缘的位置绘制轮廓

(3)与边框不同之处:轮廓不占用空间;轮廓可能是非矩形。

(4)

div{border:2px solid black;outline:2px solid red;outline-offset:15px;}
 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/chencuixin/p/6759503.html

你可能感兴趣的文章
Android系统进程Zygote启动过程的源代码分析(2)
查看>>
Powershell管理系列(三十七)PowerShell操作之比较两个CSV文件内容
查看>>
Oracle 变量绑定与变量窥视合集系列二
查看>>
“软件测试系列”学习路线图
查看>>
美国红帽软件公司是做什么的
查看>>
Powershell查询多个指定的收件人是否收到特定主题的邮件
查看>>
Memcached进程挂掉自动重启脚本
查看>>
论“软件测试实施”
查看>>
windows2012的NIC Teaming配置
查看>>
关于Saltstack halite 配置管理及二次开发ui [原salt-ui]
查看>>
针对敲诈病毒(WanaCrypt0r2.0)的应对方案
查看>>
网络地址转换--静态NAT(上)
查看>>
网管到底要学什么(三)
查看>>
Exchange中限制部分用户外网访问
查看>>
.NET简谈组件程序设计之(delegate与event关系)
查看>>
21.Azure备份Azure上的虚拟机(下)
查看>>
Ext JS 4.1 RC2 Released发布
查看>>
《兵临城下》:360输在“斯大林格勒”?
查看>>
如何从互联网获取Puppet的各项特殊资源
查看>>
Smack知识知多少
查看>>