css3练习
.div{position: relative;border: 1px solid #111;width: 80px;height: 60px}
.div div{width: 20px;height: 20px;border-radius:50%;background: #111;position: absolute;}
.div div:nth-of-type(1){animation: aa .4s alternate infinite;top:;left: 100px;}
.div div:nth-of-type(2){animation: aa .4s ease 0.1s alternate infinite;top:5px;left: 114px;}
.div div:nth-of-type(3){animation: aa .4s ease 0.2s alternate infinite;top:20px;left: 120px;}
.div div:nth-of-type(4){animation: aa .4s ease 0.3s alternate infinite;top:35px;left: 114px;}
.div div:nth-of-type(5){animation: aa .4s ease 0.4s alternate infinite;top:40px;left: 100px;}
.div div:nth-of-type(6){animation: aa .4s ease .5s alternate infinite;top:35px;left: 86px;}
.div div:nth-of-type(7){animation: aa .4s ease .6s alternate infinite;top:20px;left: 80px;}
.div div:nth-of-type(8){animation: aa .4s ease .7s alternate infinite;top:5px;left: 86px;}
@keyframes aa {
from{transform: scale(.7);}to{transform: scale(.3);}
}
<div class="div">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
读条的实现2
.circle{margin: 100px;height: 40px;width: 40px;position: absolute;}
.circle p{height: 10px;width: 10px;border-radius: 50%;background: #000;position: absolute;animation: circlebox 1s infinite ease}
.circle p:nth-of-type(1){left:;top:;animation-delay: .1s}
.circle p:nth-of-type(2){right:;top:;animation-delay: .3s}
.circle p:nth-of-type(3){right:;bottom:;animation-delay: .5s}
.circle p:nth-of-type(4){left:;bottom:;animation-delay: .7s}
.circle:nth-of-type(2){transform: rotate(45deg)}
.circle:nth-of-type(2) p:nth-of-type(1){animation-delay: .2s}
.circle:nth-of-type(2) p:nth-of-type(2){animation-delay: .4s}
.circle:nth-of-type(2) p:nth-of-type(3){animation-delay: .6s}
.circle:nth-of-type(2) p:nth-of-type(4){animation-delay: .8s}
@keyframes circlebox {
0%{transform: scale(0)}
50%{transform: scale(1)}
100%{transform: scale(0)}
}
<div class="circle">
<p></p>
<p></p>
<p></p>
<p></p>
</div>
<div class="circle">
<p></p>
<p></p>
<p></p>
<p></p>
</div>
太极图旋转
.tj{position: relative;animation: tjrotate 1s linear infinite;height: 100px;width: 100px;}
.whiteb{ height: 100px; width: 50px;border-top-right-radius: 50px;border-bottom-right-radius: 50px;background: #fff;position: absolute;right:;top:;}
.whiteu{ height: 50px; width: 50px;border-radius: 50%;background: #fff;position: absolute;left: 25px;top:}
.blackb{ height: 100px; width: 100px;border-radius: 50%;background: #000;}
.blacku{ height: 50px; width: 50px;border-radius: 50%;background: #000;position: absolute;left: 25px;top: 50px;}
.blacku1{ height: 20px; width: 20px;border-radius: 50%;background: #000;position: absolute;left: 40px;top: 15px;}
.whiteu1{ height: 20px; width: 20px;border-radius: 50%;background: #fff;position: absolute;left: 40px;top: 65px;}
@keyframes tjrotate {
from{transform: rotate(0)}to{transform: rotate(360deg)}
}
<div class="tj">
<div class="blackb"></div>
<div class="whiteb"></div>
<div class="whiteu"></div>
<div class="blacku"></div>
<div class="whiteu1"></div>
<div class="blacku1"></div>
</div>
折扇效果
.zs{margin: 0 auto;width: 600px;position: relative;height: 200px}
.zs div{height: 200px;width: 50px;left: 50%;transform-origin: center bottom;box-shadow: 2px 2px 2px #222}
.zs div:nth-of-type(1){background: #0f0;position: absolute;animation: move1 1s infinite alternate;}
.zs div:nth-of-type(2){background: #00f;position: absolute;animation: move2 1s infinite alternate;}
.zs div:nth-of-type(3){background: #f00;position: absolute;animation: move3 1s infinite alternate;}
.zs div:nth-of-type(4){background: #f00;position: absolute;animation: move4 1s infinite alternate;}
.zs div:nth-of-type(5){background: #f00;position: absolute;animation: move5 1s infinite alternate;}
.zs div:nth-of-type(6){background: #f00;position: absolute;animation: move6 1s infinite alternate;}
@keyframes move1 {from{transform: rotate(0);opacity:;}to{transform: rotate(15deg);}opacity: 1;}
@keyframes move2 {from{transform: rotate(0);opacity:;}to{transform: rotate(30deg);opacity:;}}
@keyframes move3 {from{transform: rotate(0);opacity:;}to{transform: rotate(45deg);opacity:;}}
@keyframes move4 {from{transform: rotate(0);opacity:;}to{transform: rotate(60deg);opacity:;}}
@keyframes move5 {from{transform: rotate(0);opacity:;}to{transform: rotate(75deg);opacity:;}}
@keyframes move6 {from{transform: rotate(0);}to{transform: rotate(90deg);}}
<div class="zs">
<div>6</div>
<div>5</div>
<div >4</div>
<div>3</div>
<div>2</div>
<div>1</div>
</div>
div hover以后,框内出现移动图标
.divh{height: 100px;width: 100px;background: url("../img/1.jpg");position: relative;overflow: hidden;}
.divh div{height: 30px;width: 30px;transition:all 1s}
.divh div:nth-of-type(1){background: url("../img/2.jpg") -100px -100px;position: absolute;top:50px;left: -30px;}
.divh:hover div:nth-of-type(1){left: 50px;top:50px;}
.divh div:nth-of-type(2){background: url("../img/3.jpg") -100px -100px;position: absolute;top:50px;right:-30px;}
.divh:hover div:nth-of-type(2){right: 50px;top:50px;}
.divh div:nth-of-type(3){background:#222;position: absolute;opacity:;height: 100px;width: 100px;}
.divh:hover div:nth-of-type(3){opacity: .5;}
<div class="divh">
<div></div>
<div></div>
<div></div>
</div>
手风琴效果 一定要有a的锚点作用,否则没有div的target伪类效果,加上边框写三角形
.listbox{width: 400px;margin: 20px auto;}
.listbox .divs{position: relative;}
.listbox .divs a{display: block; height: 30px;background: linear-gradient(#bbb,#999);border-radius: 5px;
line-height: 30px;color: #111;padding-left: 10px;text-decoration: none;}
.listbox .divs a:hover{background: linear-gradient(#0f0,#080);color: #fff}
边框写三角形
.listbox .divs span{height:;width:;right: 5px;position: absolute;top: 13px;border-right: 5px solid rgba(0,0,0,0);
border-bottom: 5px solid transparent;border-top: 5px solid white;border-left: 5px solid transparent;}
.listbox .divs p{overflow:auto;height:;padding-left:10px;margin: 5px 0;transition: all .5s;}
/* 当前活动窗口:target伪类 */
.listbox .divs:target p{height: 100px;}
.listbox .divs:target span{border-top: 5px solid transparent;border-left: 5px solid white;top: 10px;}
.listbox .divs:target a{background: linear-gradient(#0f0,#080);color: #fff}
<div class="listbox">
<div class="divs" id="list1">
<a href="#list1">Brand</a><span></span>
<p> There are moments in life when you miss someone so much that you just want to pick them from your dreams and hug them for real! Dream what you want to dream;go where you want to go;be what you want to be,because you have only one life and one chance to do all the things you want to do.
May you have enough happiness to make you sweet,enough trials to make you strong,enough sorrow to keep you human,enough hope to make you happy? Always put yourself in others’shoes.If you feel that it hurts you,it probably hurts the other person, too.
The happiest of people don’t necessarily have the best of everything;they just make the most of everything that comes along their way.Happiness lies for those who cry,those who hurt, those who have searched,and those who have tried,for only they can appreciate the importance of people who have touched their lives.Love begins with a smile,grows with a kiss and ends with a tear.The brightest future will always be based on a forgotten past, you can’t go on well in lifeuntil you let go of your past failures and heartaches.
</p>
</div>
<div class="divs" id="list2">
<a href="#list2">Brand</a><span></span>
<p> There are moments in life when you miss someone so much that you just want to pick them from your dreams and hug them for real! Dream what you want to dream;go where you want to go;be what you want to be,because you have only one life and one chance to do all the things you want to do.
May you have enough happiness to make you sweet,enough trials to make you strong,enough sorrow to keep you human,enough hope to make you happy? Always put yourself in others’shoes.If you feel that it hurts you,it probably hurts the other person, too.
The happiest of people don’t necessarily have the best of everything;they just make the most of everything that comes along their way.Happiness lies for those who cry,those who hurt, those who have searched,and those who have tried,for only they can appreciate the importance of people who have touched their lives.Love begins with a smile,grows with a kiss and ends with a tear.The brightest future will always be based on a forgotten past, you can’t go on well in lifeuntil you let go of your past failures and heartaches.
</p>
</div>
<div class="divs" id="list3">
<a href="#list3">Brand</a><span></span>
<p> There are moments in life when you miss someone so much that you just want to pick them from your dreams and hug them for real! Dream what you want to dream;go where you want to go;be what you want to be,because you have only one life and one chance to do all the things you want to do.
May you have enough happiness to make you sweet,enough trials to make you strong,enough sorrow to keep you human,enough hope to make you happy? Always put yourself in others’shoes.If you feel that it hurts you,it probably hurts the other person, too.
The happiest of people don’t necessarily have the best of everything;they just make the most of everything that comes along their way.Happiness lies for those who cry,those who hurt, those who have searched,and those who have tried,for only they can appreciate the importance of people who have touched their lives.Love begins with a smile,grows with a kiss and ends with a tear.The brightest future will always be based on a forgotten past, you can’t go on well in lifeuntil you let go of your past failures and heartaches.
</p>
</div>
</div>
nav导航栏案例
.nav{height: 40px;width: 1000px;overflow: hidden;border: 1px solid #333;margin: 0 auto;}
.nav ul{list-style: none;}
.nav ul li{float: left;height: 40px;width: 110px;}
.nav ul li a{line-height: 40px;border-right: 1px dashed #888;display: block;transition: all .5s;text-decoration: none;padding-left:30px;background: url("../img/navbg.png") no-repeat; }
.nav ul li:nth-of-type(1):hover a{background-position: 5px -70px;}
.nav ul li:nth-of-type(1) a{background-position: 5px -35px;}
<div class="nav">
<ul>
<li><a href="#">我的主页</a></li>
<li><a>我的主页</a></li>
<li><a>我的主页</a></li>
<li><a>我的主页</a></li>
</ul>
</div>
css3练习的更多相关文章
- 纯CSS3实现的一些酷炫效果
之前在网上看到一些用纯CSS3实现的酷炫效果,以为实现起来比较困难,于是想看看具体是怎么实现的. 一.笑脸猫动画 实现效果如下: 这个实现起来确实比较麻烦,很多地方需要花时间,有耐心地调整. 1.先看 ...
- CSS3 border-radius边框圆角
在CSS3中提供了对边框进行圆角设定的支持,可对边框1~4个角进行圆角样式设置. 目录 1. 介绍 2. value值的格式和类型 3. border-radius 1~4个参数说明 4. 在线示例 ...
- CSS3 3D立方体效果-transform也不过如此
CSS3系列已经学习了一段时间了,第一篇文章写了一些css3的奇技淫巧,原文戳这里,还获得了较多网友的支持,在此谢过各位,你们的支持是我写文章最大的动力^_^. 那么这一篇文章呢,主要是通过一个3D立 ...
- 三分钟学会用 js + css3 打造酷炫3D相册
之前发过该文,后来不知怎么回事不见了,现在重新发一下. 中秋主题的3D旋转相册 如图,这是通过Javascript和css3来实现的.整个案例只有不到80行代码,我希望通过这个案例,让正处于迷茫期的j ...
- 使用CSS3实现一个3D相册
CSS3系列我已经写过两篇文章,感兴趣的同学可以先看一下CSS3初体验之奇技淫巧,CSS3 3D立方体效果-transform也不过如此 第一篇主要列出了一些常用或经典的CSS3技巧和方法:第二篇是一 ...
- Web大前端时代之:HTML5+CSS3入门系列
准备来一波新技术,待续.... Old: 联系源码:https://github.com/dunitian/LoTHTML5 文档下载:https://github.com/dunitian/LoTD ...
- 07. Web大前端时代之:HTML5+CSS3入门系列~H5 地理位置
Web大前端时代之:HTML5+CSS3入门系列:http://www.cnblogs.com/dunitian/p/5121725.html 源码:https://github.com/duniti ...
- 前端制作动画的几种方式(css3,js)
制作动态的网页是是前端工程师必备的技能,很好的实现动画能够极大的提高用户体验,增强交互效果,那么动画有多少实现方式,一直对此有选择恐惧症的我就总结一下,以便在开发的时候选择最好的实现方式. 1.css ...
- 原生js+css3实现图片自动切换,图片轮播
运用CSS3transition及opacity属性 制作图片轮播动画 自己这两天根据用js来控制触发CSS3中transition属性,从而写出来的以CSS3动画为基础,js控制过程的图片轮播 运用 ...
- css3线条围绕跑马+jquery打字机效果
原文地址:css3线条围绕跑马+jquery打字机效果 有图有真相,今天偶然看到了一种效果,仔细看了下,发现它是用css的clip+css3的动画实现的,简直叼.于是自己拿来了前一阵子写的打字机效果, ...
随机推荐
- CAS及其ABA问题
CAS.volatile是JUC包实现同步的基础.Synchronized下的偏向锁.轻量级锁的获取.释放,lock机制下锁的获取.释放,获取失败后线程的入队等操作都是CAS操作锁标志位.state. ...
- mysql安装-yum方式
1.环境 查看当前系统环境,使用的是 centos release 6.5 (Final). 2.检查当前系统是否已经安装过mysql rpm -qa | grep mysql 3.如果有,那么删除已 ...
- HTTP协议请求响应模型
HTTP协议请求响应模型:以”用户登录“这个场景来描述 第一步:客户端发起请求到API接口层,操作:用户在客户端填写用户名和密码,点击登录,发送请求. 第二步:api接收到客户端发起的用户请求,api ...
- Badboy - 导出脚本,用于JMeter并发测试
参考: http://leafwf.blog.51cto.com/872759/1141011 http://www.51testing.com/html/00/130600-1367743.html ...
- 2019nc#10
题号 标题 已通过代码 题解/讨论 通过率 团队的状态 A Blackjack 点击查看 背包DP 32/109 补好了 B Coffee Chicken 点击查看 进入讨论 738/2992 通过 ...
- CodeForces 765 F Souvenirs 线段树
Souvenirs 题意:给你n个数, m次询问, 对于每次一次询问, 求出询问区间内绝对值差值的最小值. 题解:先按查询的右端点从小到大sort一下,然后对于塞入一个数的时候, 就处理出所有左端点到 ...
- 淘淘购物系统 (Python)
#首页def tao_first(): t1 = '欢迎进入淘淘购物'.center(110) print(t1) print('~' * 130) t2 = '注册'.center(20) prin ...
- 1 PY环境与变量
一 环境与文件形式 1.环境搭建http://jingyan.baidu.com/article/eae07827f7f2d01fec5485f7.html 2. python 则进入交互模式 ex ...
- shell 的while语句
转 http://blog.chinaunix.net/uid-25880122-id-2901409.html while循环的格式 while expression do command co ...
- C#开发BIMFACE系列25 服务端API之获取模型数据10:获取楼层对应面积分区列表
系列目录 [已更新最新开发文章,点击查看详细] 在<C#开发BIMFACE系列22 服务端API之获取模型数据7:获取多个模型的楼层信息>中,返回的楼层信息结果中包含了楼层的具体信 ...