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的动画实现的,简直叼.于是自己拿来了前一阵子写的打字机效果, ...
随机推荐
- .Net 基于Memcache集群的分布式Session
简述 基于Memcache的Session大家都各有各的说法,比方说:当memcached集群发生故障(比如内存溢出)或者维护(比如升级.增加或减少服务器)时,用户会无法登录,或者被踢掉线等等,每种技 ...
- 掀起你的盖头来:浅谈项目管理办公室(PMO)
[提示]本文为“分享:<PMBOOK>读书笔记系列”由傻瓜(来自人人都是产品经理6群)编写. 之前与大家一定对项目.项目管理.项目集.项目组合等知识进行了简单的学习,如果有不太清楚和不太明 ...
- lightoj 1036 - A Refining Company(简单dp)
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1036 题解:设dp[i][j]表示处理到(i,j)点时的最大值然后转移显然是 ...
- JavaScript简单的弹幕
弹幕 首先是弹幕的位置,是要从最右滑到最左,为了防止随机高度弹幕会覆盖的问题,设置了通道. 每一个通道是从左到右的一条,高度固定,这样不同通道的弹幕不会相互覆盖. 弹幕滑动就是简单设置CSS属性 t ...
- briup_jdbc自建工具类终极版
总结:此次构建工具类,难点在于查询,所需要的功能是 不管是 oracle还是mysql 都可以连接,并且 提供所需要的实体类,都可以将查询内容封装到实体类中去 遇到的难点 连接时,是从prppert ...
- 网络编程之Socket代码实例
网络编程之Socket代码实例 一.基本Socket例子 Server端: # Echo server program import socket HOST = '' # Symbolic name ...
- iOS -打包上传成功,在"构建版本"一直刷不出来
今天提交版本到appstore,构建版本一直不出来,等了一天也没有出来,其实就是权限问题,iOS13 来了,所以面临的问题随之而来,苹果给邮箱发了这段话: Dear Developer,We iden ...
- Mysql - 高可用方案之MHA
一.概述 本文将介绍mysql的MHA(Master High Availability)方案,官方文档地址:https://github.com/yoshinorim/mha4mysql-manag ...
- STL目录
觉得STL有必要讲一下,毕竟STL包含的东西太又用了. STL(Standard Template Library)这个玩意是啥,怎么来的之类的我就不说了,百度上一大推. 我就说一下ACM或者OI中会 ...
- Charles 破解版免费下载和注册安装教程
本文参考:[Charles 破解版免费下载和注册安装教程](https://www.axihe.com/tools/charles/charles/free-use.html) **软件开发不易,请尽 ...