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的动画实现的,简直叼.于是自己拿来了前一阵子写的打字机效果, ...
随机推荐
- [Python] socket发送UDP广播实现聊天室功能
一.说明 本文主要使用socket.socket发送UDP广播来实现聊天室功能. 重点难点:理解UDP通讯流程.多线程.UDP广播收发等. 测试环境:Win10\Python3.5. 程序基本流程:创 ...
- Delphi - 创建text文件并添加数据到文件中
创建文本文件 代码如下: //创建一个文本文件 procedure CreateTextFile(); var AssignFile(TF,'C:\tmp\1.txt'); ReWrite(TF); ...
- 关于turtle画蟒蛇小实例
import turtle turtle.setup(800,600) turtle.pensize(25) turtle.pencolor('blue') turtle.penup() #抬笔 tu ...
- mysql类似oracle rownum写法
rownum是oracle才有的写法,rownum在oracle中可以用于取第一条数据,或者批量写数据时限定批量写的数量等 mysql取第一条数据写法 SELECT * FROM t order by ...
- xsd to javabean
1. cd jdk/bin 2. xjc -p com.skyecho.product.air.ibe.api.model.airfaredisplay d:/temp/OTA_AirFareDisp ...
- 从入门到入土的JS 随笔day01
js 的全称是javascript ,JavaScript一种直译式脚本语言,是一种动态类型.弱类型.基于原型的语言,内置支持类型. 它的解释器被称为JavaScript引擎,为浏览器的一部分,广泛用 ...
- HDU - 4358 Boring counting (dsu on tree)
Boring counting: http://acm.hdu.edu.cn/showproblem.php?pid=4358 题意: 求一棵树上,每个节点的子节点中,同一颜色出现k次 的 个数. 思 ...
- POJ-1984-Navigation Nightmare+带权并查集(中级
传送门:Navigation Nightmare 参考:1:https://www.cnblogs.com/huangfeihome/archive/2012/09/07/2675123.html 参 ...
- CodeForces 628 D Magic Numbers 数位DP
Magic Numbers 题意: 题意比较难读:首先对于一个串来说, 如果他是d-串, 那么他的第偶数个字符都是是d,第奇数个字符都不是d. 然后求[L, R]里面的多少个数是d-串,且是m的倍数. ...
- codeforces 813 D. Two Melodies(dp)
题目链接:http://codeforces.com/contest/813/problem/D 题意:求两个不相交的子集长度之和最大是多少,能放入同一子集的条件是首先顺序不能变,然后每一个相邻的要么 ...