最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
CSS3如何实现时间轴特效 CSS3实现时间轴特效代码示例
时间:2020-11-03 编辑:袖梨 来源:一聚教程网
CSS3如何实现时间轴特效?本篇文章小编给大家分享一下CSS3实现时间轴特效代码示例,文章代码介绍的很详细,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。
效果:
HTML结构:
2015-07-02
暴走大事件第一季
2015-07-02
暴走大事件第二季
这里简化了一下HTML结构,.time类表示在右边,.timeLeft表示在左边,然后加点上外边距就可以了,每一块里面的内容我就删减掉了。
CSS样式代码如下:
css;">body{ background: #333; } h1{ text-align: center; color:#fff; } .timezone{ background: lightblue; margin: 0 auto; margin-top:50px; border-radius: 3px; position: relative; -webkit-animation: heightSlide 2s linear; } @-webkit-keyframes heightSlide{ 0%{ height: 0; } 100%{ } } .timezone:after{ content: '未完待续...'; color:#fff; position: absolute; margin-left: -35px; bottom: -30px; -webkit-animation: showIn 4s ease; } .timezone .time,.timezone .timeLeft{ position: absolute; margin-left: -10px; margin-top:-10px; border-radius: 50%; border:4px solid rgba(255,255,255,0.5); background: lightblue; -webkit-transition: all 0.5s; -webkit-animation: showIn ease; } .timezone .time:nth-child(1){ -webkit-animation-duration:1s; } .timezone .timeLeft:nth-child(2){ -webkit-animation-duration:1.5s; } .timezone .time:nth-child(3){ -webkit-animation-duration:2s; } .timezone .timeLeft:nth-child(4){ -webkit-animation-duration:2.5s; } @-webkit-keyframes showIn{ 0%,70%{ opacity: 0; } 100%{ opacity: 1; } } .timezone .time h2,.timezone .timeLeft h2{ position: absolute; margin-left: -120px; margin-top: 3px; color:#eee; font-size: 14px; cursor:pointer; -webkit-animation: showIn 3s ease; } .timezone .timeLeft h2{ margin-left: 60px; } .timezone .time:hover,.timezone .timeLeft:hover{ border:4px solid lightblue; background: lemonchiffon; box-shadow: 0 0 2px 2px rgba(255,255,255,0.4); } .timezone .time div,.timezone .timeLeft div{ position: absolute; top:50%; margin-top: -25px; left:50px; background: lightblue; border:3px solid #eee; border-radius: 10px; z-index: 2; overflow: hidden; cursor:pointer; -webkit-animation: showIn 3s ease; -webkit-transition: all 0.5s; } .timezone .timeLeft div{ left:-337px; } .timezone .time div:hover,.timezone .timeLeft div:hover{ } .timezone .time div p,.timezone .timeLeft div p{ color: #fff; font-weight: bold; text-align: center; } .timezone .time:before,.timezone .timeLeft:before{ content: ''; position: absolute; top:0px; left: 32px; border:10px solid transparent; border-right:10px solid #eee; z-index:-1; -webkit-animation: showIn 3s ease; } .timezone .timeLeft:before{ left:-33px; border:10px solid transparent; border-left:10px solid #eee; } .timezone .time div ul,.timezone .timeLeft div ul{ list-style: none; padding:5px 0 0; border-top:2px solid #eee; color:#fff; text-align: center; } .timezone .time div li,.timezone .timeLeft div li{ display: inline-block; line- }
相关文章
- css3中仿放大镜效果的几种方式原理介绍 10-26
- CSS3切割轮播图的代码展示 10-26
- css3制作背景渐变动画效果教程 10-26
- CSS3呈现的定价表 09-16
- CSS3如何制作彩虹按钮样式 09-16
- CSS3图片悬停的切换按钮介绍 09-16
热门栏目
-
php教程
php入门 php安全 php安装 php常用代码 php高级应用 -
asp.net教程
基础入门 .Net开发 C语言 VB.Net语言 WebService -
手机开发
安卓教程 ios7教程 Windows Phone Windows Mobile 手机常见问题 -
css教程
CSS入门 常用代码 经典案例 样式布局 高级应用 -
网页制作
设计基础 Dreamweaver Frontpage js教程 XNL/XSLT -
办公数码
word excel powerpoint 金山WPS 电脑新手 -
jsp教程
Application与Applet J2EE/EJB/服务器 J2ME开发 Java基础 Java技巧及代码