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 Backgrounds属性相关介绍
May 11 HTML / CSS
纯css3制作网站后台管理面板
Dec 30 HTML / CSS
利用CSS3把图片变成灰色模式的实例代码
Sep 06 HTML / CSS
css3针对移动端卡顿问题的解决(动画性能优化)
Feb 14 HTML / CSS
CSS3 box-shadow属性实例详解
Jun 19 HTML / CSS
HTML5 实战PHP之Web页面表单设计
Oct 09 HTML / CSS
程序设计HTML5 Canvas API
Apr 08 HTML / CSS
HTML中使用SVG与SVG预定义形状元素介绍
Jun 28 HTML / CSS
【HTML5】Canvas绘制简单图片教程
May 13 HTML / CSS
详解移动端Html5页面中1px边框的几种解决方法
Jul 24 HTML / CSS
使用Html5多媒体实现微信语音功能
Jul 26 HTML / CSS
Html5自定义字体解决方法
Oct 09 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单例模式实现(对象只被创建一次)
2012/12/05 PHP
PHP对称加密算法(DES/AES)类的实现代码
2017/11/14 PHP
PHP实现的分解质因数操作示例
2018/08/01 PHP
In Javascript Class, how to call the prototype method.(three method)
2007/01/09 Javascript
简介JavaScript中的push()方法的使用
2015/06/09 Javascript
JavaScript数据存储 Cookie篇
2016/07/02 Javascript
JS弹出窗口的运用与技巧大全
2016/11/01 Javascript
基于JS设计12306登录页面
2016/12/28 Javascript
微信小程序 定位到当前城市实现实例代码
2017/02/23 Javascript
layui文件上传实现代码
2017/05/20 Javascript
javascript将url解析为json格式的两种方法
2017/08/18 Javascript
Vue2.0基于vue-cli+webpack Vuex的用法(实例讲解)
2017/09/15 Javascript
js中实例与对象的区别讲解
2019/01/21 Javascript
实现vuex与组件data之间的数据同步更新方式
2019/11/12 Javascript
[00:32]2018DOTA2亚洲邀请赛VGJ.T出场
2018/04/03 DOTA
Python 深入理解yield
2008/09/06 Python
Python 提取dict转换为xml/json/table并输出的实现代码
2016/08/28 Python
Python tkinter模块中类继承的三种方式分析
2017/08/08 Python
python中 logging的使用详解
2017/10/25 Python
使用DataFrame删除行和列的实例讲解
2018/04/08 Python
python3图片文件批量重命名处理
2019/10/31 Python
tensorflow-gpu安装的常见问题及解决方案
2020/01/20 Python
python3 字符串知识点学习笔记
2020/02/08 Python
Python爬取YY评级分数并保存数据实现过程解析
2020/06/01 Python
详解Pandas 处理缺失值指令大全
2020/07/30 Python
一款纯css3实现的竖形二级导航的实例教程
2014/12/11 HTML / CSS
高街生活方式全球在线商店:AZBRO
2017/08/26 全球购物
美体小铺奥地利官方网站:The Body Shop奥地利
2019/04/11 全球购物
ColourPop美国官网:卡拉泡泡,洛杉矶彩妆品牌
2019/04/28 全球购物
南京迈特望C/C++面试题
2012/07/09 面试题
招聘单位介绍信
2014/01/14 职场文书
职工代表大会主持词
2014/04/01 职场文书
庆祝儿童节标语
2014/10/09 职场文书
自主招生自荐信怎么写
2015/03/24 职场文书
十八大观后感
2015/06/12 职场文书
聊聊mysql都有哪几种分区方式
2022/04/13 MySQL