css3.0 图形构成实例练习二


Posted in HTML / CSS onMarch 19, 2013

主要知识点
① transform属性:

ratate(旋转度数)

scale(等比例缩放)

skew(x , y);让元素倾斜显示,包含两个参数值,分别表示X轴和Y轴倾斜的角度,如果第二个参数为空,则默认为0,参数为负表示向相反方向倾斜。
②animate 适用于鼠标经过产生宽度,高度,left,top等等 示例 transition:1s ease all;所有事件产生动画!

复制代码
代码如下:

div {
-webkit-animation-name: pulse;
-webkit-animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-direction: alternate;
}@-webkit-keyframes pulse {
from {
opacity: 0.0;
font-size: 100%;
}
to {
opacity: 1.0;
font-size: 200%;
}
}style
*{ margin: 0; padding: 0;}
body {
overflow: hidden;
}
#clouds{
background:-webkit-linear-gradient(top,#c9dbe9 0%,#fff 100%);/*等价于background:-webkit-gradient(linear,left top,left bottom,from(c9dbe9),to(#fff))*/
background:-moz-linear-gradient(top,#c9dbe9 0%,#fff 100%);
background:-o-linear-gradient(top,#c9dbe9 0%,#fff 100%);
padding:100px 0px;
}
.cloud{
width:200px;
height:60px;
background:#FFF;
border-radius:200px;
-webkit-border-radius:200px;
-moz-border-radius:200px;
-o-border-radius:200px;
position:relative;}
.cloud:after,.cloud:before{
content:'';
position:absolute;
background:#FFF;
width:100px;
height:80px;
top:-15px;
left:10px;
border-radius:100px;
-webkit-border-radius:100px;
-moz-border-radius:100px;
-o-border-radius:100px;}
.cloud:after{
width:120px;
height:120px;
top:-55px;
left:auto;
right:15px;}
.x1{
-webkit-animation:moveclouds 25s linear infinite;
-moz-animation:moveclouds 25s linear infinite;
-o-animation:moveclouds 25s linear infinite;}
.x2{
left:200px;
transform:scale(0.6);
-webkit-transform:scale(0.6);
-moz-transform:scale(0.6);
-o-transform:scale(0.6);
opacity:0.6;
animation:moveclouds 25s linear infinite;
-webkit-animation:moveclouds 25s linear infinite;
-moz-animation:moveclouds 25s linear infinite;
-o-animation:moveclouds 25s linear infinite;}
.x3{
top:-200px;
left:-250px;
transform:scale(0.6);
-webkit-transform:scale(0.6);
-moz-transform:scale(0.6);
-o-transform:scale(0.6);
opacity:0.6;
animation:moveclouds 25s linear infinite;
-webkit-animation:moveclouds 25s linear infinite;
-moz-animation:moveclouds 25s linear infinite;
-o-animation:moveclouds 25s linear infinite;}
.x4{
top:200px;
left:470px;
transform:scale(0.6);
-webkit-transform:scale(0.6);
-moz-transform:scale(0.6);
-o-transform:scale(0.6);
opacity:0.6;
animation:moveclouds 25s linear infinite;
-webkit-animation:moveclouds 25s linear infinite;
-moz-animation:moveclouds 25s linear infinite;
-o-animation:moveclouds 25s linear infinite;}
.x5{
left:470px;
top:-250px;
transform:scale(0.8);
-webkit-transform:scale(0.8);
-moz-transform:scale(0.8);
-o-transform:scale(0.8);
opacity:0.8;
animation:moveclouds 25s linear infinite;
-webkit-animation:moveclouds 18s linear infinite;
-moz-animation:moveclouds 18s linear infinite;
-o-animation:moveclouds 18s linear infinite;}
@-webkit-keyframes moveclouds{
0%{margin-left:1000px;}
100%{margin-left:-1000px;}
}
@-moz-keyframes moveclouds{
0%{margin-left:1000px;}
100%{margin-left:-1000px;}
}
@-o-keyframes moveclouds{
0%{margin-left:1000px;}
100%{margin-left:-1000px;}
}
html
<div id="clouds">

<div class="cloud x1"></div>

<div class="cloud x2"></div>

<div class="cloud x3"></div>

<div class="cloud x4"></div>

<div class="cloud x5"></div>
</div>

HTML / CSS 相关文章推荐
使用css3背景渐变中的透明度来设置不同颜色的背景渐变
Mar 31 HTML / CSS
纯CSS3制作的鼠标悬停时边框旋转
Jan 03 HTML / CSS
HTML5边玩边学(2)基础绘图实现方法
Sep 21 HTML / CSS
HTML5 canvas基本绘图之图形组合
Jun 27 HTML / CSS
HTML5+CSS3实现机器猫
Oct 17 HTML / CSS
浅谈HTML5 FileReader分布读取文件以及其方法简介
Nov 09 HTML / CSS
iphoneX 适配客户端H5页面的方法教程
Dec 08 HTML / CSS
Html5页面中的返回实现的方法
Feb 26 HTML / CSS
HTML5 图片预加载的示例代码
Mar 25 HTML / CSS
一个基于canvas的移动端图片编辑器的实现
Oct 28 HTML / CSS
CSS实现多个元素在盒子内两端对齐效果
Mar 30 HTML / CSS
CSS中em的正确打开方式详解
Apr 08 HTML / CSS
css3.0 图形构成实例练习一
Mar 19 #HTML / CSS
基于css3实现漂亮便签样式
Mar 18 #HTML / CSS
css3 按钮 利用css3实现超酷下载按钮
Mar 18 #HTML / CSS
利用css3制作3D样式按钮实现代码
Mar 18 #HTML / CSS
css3 按钮样式简单可扩展创建
Mar 18 #HTML / CSS
css3气泡 css3关键帧动画创建的动态通知气泡
Feb 26 #HTML / CSS
css 省略号 css3让多余的字符串消失并附加省略号的实现代码
Feb 07 #HTML / CSS
You might like
php 常用字符串函数总结
2008/03/15 PHP
php实现从ftp服务器上下载文件树到本地电脑的程序
2009/02/10 PHP
php使用CURL伪造IP和来源实例详解
2015/01/15 PHP
利用ajax和PHP实现简单的流程管理
2017/03/23 PHP
PHP实现Redis单据锁以及防止并发重复写入
2018/04/10 PHP
PHP终止脚本运行三种实现方法详解
2020/09/01 PHP
双击滚屏-常用推荐
2006/11/29 Javascript
JavaScript 解析读取XML文档 实例代码
2009/07/07 Javascript
自写的一个jQuery圆角插件
2010/10/26 Javascript
jqTransform form表单美化插件使用方法
2012/07/05 Javascript
javascript中负数算术右移、逻辑右移的奥秘探索
2013/10/17 Javascript
window.showModalDialog()返回值的学习心得总结
2014/01/07 Javascript
jQuery实现文本展开收缩特效
2015/06/03 Javascript
ajax在兼容模式下失效的快速解决方法
2016/03/22 Javascript
js实现动态创建的元素绑定事件
2016/07/19 Javascript
AngularJS使用ng-Cloak阻止初始化闪烁问题的方法
2016/11/03 Javascript
AngularJS中的JSONP实例解析
2016/12/01 Javascript
在 Linux/Unix 中不重启 Vim 而重新加载 .vimrc 文件的流程
2018/03/21 Javascript
20道JS原理题助你面试一臂之力(必看)
2019/07/22 Javascript
微信小程序实现同时上传多张图片
2020/02/03 Javascript
[00:17]游戏风云独家报道:DD赛后说出数字秘密 吓死你们啊!
2014/07/13 DOTA
Python中operator模块的操作符使用示例总结
2016/06/28 Python
python中利用队列asyncio.Queue进行通讯详解
2017/09/10 Python
Python2/3中urllib库的一些常见用法
2017/12/19 Python
解决python3中解压zip文件是文件名乱码的问题
2018/03/22 Python
Python格式化输出%s和%d
2018/05/07 Python
python 实现识别图片上的数字
2019/07/30 Python
Django中ajax发送post请求 报403错误CSRF验证失败解决方案
2019/08/13 Python
python路径的写法及目录的获取方式
2019/12/26 Python
python--shutil移动文件到另一个路径的操作
2020/07/13 Python
应届毕业生自我鉴定范文
2013/12/27 职场文书
中秋节主持词
2014/04/02 职场文书
入党转正申请报告
2015/05/15 职场文书
爱国主义影片观后感
2015/06/18 职场文书
2016公司中秋节寄语
2015/12/07 职场文书
python获取对象信息的实例详解
2021/07/07 Python