您现在的位置是:网站首页> 编程资料编程资料
网页中时光轴CSS实现_CSS教程_CSS_网页制作_
2021-09-13
1111人已围观
简介 这篇文章为大家分享了CSS网页中时光轴的简单实现方法,记录每个时间段、时间点所发生的事情,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
本文实例为大家分享了网页中时光轴的制作方法,供大家参考,具体内容如下
效果图:

实现代码:
XML/HTML Code复制内容到剪贴板
- >
- <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; &
相关内容
- CSS3 3D位移translate效果实例介绍 _css3_CSS_网页制作_
- 四种CSS常用的选择器使用方法和注意事项_CSS教程_CSS_网页制作_
- 浅析两列自适应布局的3种思路_css3_CSS_网页制作_
- CSS壹久柮娐得€媒_CSS_脥酶脪鲁脰脝脳梅 - 陆脜卤戮脰庐录脪
- 横向两列布局(左列固定,右列自适应)的4种CSS实现方式_CSS布局实例_CSS_网页制作_
- 网页布局入门教程 如何用CSS进行网页布局_CSS教程_CSS_网页制作_
- css文字环绕图片—遇到的问题及快速解决方法_CSS教程_CSS_网页制作_
- 如何使定义了高度和宽度的< a >里的文字垂直居中【实现代码】_CSS教程_CSS_网页制作_
- CSS3弹性盒模型开发笔记(三) _css3_CSS_网页制作_
- CSS3弹性盒模型开发笔记(一)_css3_CSS_网页制作_
点击排行
本栏推荐
