首页
网页制作
网络编程
脚本专栏
数据库
网站运营
网络安全
平面设计
CMS教程
搜索
建站极客
网页制作
CSS
正文
网页中时光轴CSS实现
所属分类:
网页制作
/
CSS
阅读数: 650
收藏 0
赞 0
分享
本文实例为大家分享了网页中时光轴的制作方法,供大家参考,具体内容如下
效果图:
实现代码:
XML/HTML Code
复制内容到剪贴板
<!DOCTYPE html
>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
title
>
时光轴
</
title
>
<
style
>
.container {
width: 800px;
margin: 50px auto;
}
.vertical-timeline {
color: #FFF;
font-family: "微软雅黑", "Microsoft YaHei";
}
.vertical-timeline-block {
width: 100%;
border-left: 2px solid #DDD;
margin: 0 20px;
position: relative;
padding-bottom: 30px;
}
/* 时间轴的左侧图标 */
.vertical-timeline-icon {
width: 40px;
height: 40px;
border-radius: 20px;
position: absolute;
left: -22px;
top: 10px;
text-align: center;
line-height: 40px;
cursor: pointer;
transition: all 0.2s ease-in;
-webkit-transition: all 0.2s ease-in;
-moz-transition: all 0.2s ease-in;
-o-transition: all 0.2s ease-in;
}
.vertical-timeline-block {
cursor: pointer;
}
.vertical-timeline-block:hover .vertical-timeline-icon {
width: 50px;
height: 50px;
border-radius: 25px;
line-height: 50px;
left: -27px;
box-shadow: 0 0 5px #CCC;
font-size: 25px;
}
/* 时间轴的左侧图标的各种样式 */
.v-timeline-icon1 {
background-color: #2aabd2;
}
.v-timeline-icon2 {
background-color: #5cb85c;
}
.v-timeline-icon3 {
background-color: #8c8c8c;
}
/* 时间轴的左侧图标上的序号*/
.vertical-timeline-icon i {
font-style: normal;
color: #FFF;
}
/* 时间轴上的具体内容 */
.vertical-timeline-content {
background-color: #5bc0de;
margin-left: 60px;
padding: 20px 30px;
border-radius: 5px;
position: relative;
}
/* 时间轴上的具体内容左侧箭头 */
.vertical-timeline-content:before {
content: '';
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #5bc0de;
border-left: 10px solid transparent;
position: absolute;
right: 100%;
top: 20px;
}
/* 时间轴的具体内容的格式 */
.timeline-content {
text-indent: 2em;
}
.time-more {
overflow: hidden;
}
.time-more .time {
float: left;
line-height: 40px;
display: inline-block;
}
.time-more .more {
float: right;
}
.time-more .more a {
display: inline-block;
height: 20px;
padding: 8px 15px;
color: #FFF;
text-decoration: none;
font-size: 15px;
}
/* “更多信息”的风格 */
.more-style1 {
border-radius: 5px;
background-color: #565656;
}
.more-style1:hover {
background-color: #696969;
}
.more-style2 {
border-radius: 5px;
background-color: #1AB394;
}
.more-style2:hover {
background-color: #18A689;
}
.more-style3 {
border-radius: 5px;
background-color: #1C84C6;
}
.more-style3:hover {
background-color: #1A7BB9;
}
</
style
>
</
head
>
<
body
>
<
div
class
=
"container"
>
<
div
class
=
"vertical-timeline"
>
<
div
class
=
"vertical-timeline-block"
>
<
div
class
=
"vertical-timeline-icon v-timeline-icon1"
>
<
i
class
=
"icon"
>
1
</
i
>
</
div
>
<
div
class
=
"vertical-timeline-content"
>
<
h2
>
时间点1
</
h2
>
<
p
class
=
"timeline-content"
>
我去吃了个午饭
</
p
>
<
p
class
=
"time-more"
>
<
span
class
=
"time"
>
2016/4/30 13:48
</
span
>
<
span
class
=
"more more-style1"
>
<
a
href
=
"#"
>
更多信息
</
a
>
</
span
>
</
p
>
</
div
>
</
div
>
<
div
class
=
"vertical-timeline-block"
>
<
div
class
=
"vertical-timeline-icon v-timeline-icon2"
>
<
i
class
=
"icon"
>
2
</
i
>
</
div
>
<
div
class
=
"vertical-timeline-content"
>
<
h2
>
时间点2
</
h2
>
<
p
class
=
"timeline-content"
>
我去吃了个午饭
</
p
>
<
p
class
=
"time-more"
>
<
span
class
=
"time"
>
2016/4/30 13:48
</
span
>
<
span
class
=
"more more-style2"
>
<
a
href
=
"#"
>
更多信息
</
a
>
</
span
>
</
p
>
</
div
>
</
div
>
<
div
class
=
"vertical-timeline-block"
>
<
div
class
=
"vertical-timeline-icon v-timeline-icon3"
>
<
i
class
=
"icon"
>
3
</
i
>
</
div
>
<
div
class
=
"vertical-timeline-content"
>
<
h2
>
时间点3
</
h2
>
<
p
class
=
"timeline-content"
>
我去吃了个午饭
</
p
>
<
p
class
=
"time-more"
>
<
span
class
=
"time"
>
2016/4/30 13:48
</
span
>
<
span
class
=
"more more-style3"
>
<
a
href
=
"#"
>
更多信息
</
a
>
</
span
>
</
p
>
</
div
>
</
div
>
<
div
class
=
"vertical-timeline-block"
>
<
div
class
=
"vertical-timeline-icon v-timeline-icon1"
>
<
i
class
=
"icon"
>
4
</
i
>
</
div
>
<
div
class
=
"vertical-timeline-content"
>
<
h2
>
时间点1
</
h2
>
<
h2
>
时间点1
</
h2
>
<
h2
>
时间点1
</
h2
>
<
h2
>
时间点1
</
h2
>
</
div
>
</
div
>
<
div
class
=
"vertical-timeline-block"
>
<
div
class
=
"vertical-timeline-icon v-timeline-icon2"
>
<
i
class
=
"icon"
>
5
</
i
>
</
div
>
<
div
class
=
"vertical-timeline-content"
>
<
h2
>
时间点1
</
h2
>
<
h2
>
时间点1
</
h2
>
<
h2
>
时间点1
</
h2
>
</
div
>
</
div
>
<
div
class
=
"vertical-timeline-block"
>
<
div
class
=
"vertical-timeline-icon v-timeline-icon3"
>
<
i
class
=
"icon"
>
6
</
i
>
</
div
>
<
div
class
=
"vertical-timeline-content"
>
<
h2
>
时间点1
</
h2
>
<
h2
>
时间点1
</
h2
>
<
h2
>
时间点1
</
h2
>
</
div
>
</
div
>
</
div
>
</
div
>
</
body
>
</
html
>
以上就是本文的全部内容,希望对大家的学习有所帮助。
更多精彩内容
其他人还在看
CSS3实现背景透明文字不透明的示例代码
这篇文章主要介绍了CSS3实现背景透明文字不透明的示例代码的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
评论 0
收藏 0
赞 0
分享
浅谈CSS中的尺寸单位
这篇文章主要介绍了浅谈CSS中的尺寸单位的相关资料,浏览器的兼容性越来越好,移动端基本是清一色的webkit,经常会用到css的不同尺寸/长度单位,这里做个整理。感兴趣的小伙伴们可以参考一下
评论 0
收藏 0
赞 0
分享
CSS中有些属性的前面会加上“*”或“_”所代表的意思
这篇文章主要介绍了CSS中有些属性的前面会加上“*”或“_”所代表的意思,需要的朋友可以参考下
评论 0
收藏 0
赞 0
分享
CSS 设置滚动条样式的实例代码
这篇文章主要介绍了CSS 设置滚动条样式的实例代码,非常不错,具有一定的参考借鉴价值,需要的朋友参考下吧
评论 0
收藏 0
赞 0
分享
纯CSS制作各种各样的网页图标(三角形、暂停按钮、下载箭头、加号等)
这篇文章主要介绍了纯CSS制作各种各样的网页图标(三角形、暂停按钮、下载箭头、加号等)的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
评论 0
收藏 0
赞 0
分享
纯css实现多级折叠菜单折叠树效果
这篇文章主要介绍了纯css实现多级折叠菜单折叠树效果,运用checkbox的checked值来判断下级栏目是否展开,通过css3选择器提供的checked伪类来实现此效果,感兴趣的朋友参考下吧
评论 0
收藏 0
赞 0
分享
CSS Grid 网格布局全解析
这篇文章主要介绍了CSS Grid 网格布局全解析的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
评论 0
收藏 0
赞 0
分享
css flex 弹性布局详解
这篇文章主要介绍了css flex 弹性布局详解的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
评论 0
收藏 0
赞 0
分享
CSS3 二级导航菜单的制作的示例
这篇文章主要介绍了CSS3 二级导航的制作的示例的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
评论 0
收藏 0
赞 0
分享
使用css禁用input、checkbox、select等html控件实现disable效果
这篇文章主要介绍了使用css禁用input、checkbox、select等html控件实现disable效果,需要的朋友可以参考下
评论 0
收藏 0
赞 0
分享
查看更多
网络赚钱
更多
即使现在停产 微商面膜至少需需5年才能卖完
怎样利用网络赚钱 网络赚钱有哪些方法
Google
做什么样的网站能赚钱?
营销型网站建设提高网站转化率的方法
冲刺双十一 如何做好淘宝双11期间的推广及运营
站长故事
更多
喜马拉雅创始人自述:网络电台一年半获取7000万用户
为何说魅族的小米路线注定走不通?
运用互联网思维的肉夹馍西少爷
为什么阿里巴巴要在美国上市不在国内上市?
其实并非所有草根站长都能驯服社区门户这匹马
个人经历:盲目的坚持更新网站真的有用吗?