其他代码

垂直时间轴特效CSS3代码

也想出现在这里?联系我们
面包多

垂直时间轴特效CSS3代码-创客云
使用方法
在 HTML 文件中引入

  1. <link href="css/font-awesome.min.css" rel="stylesheet">
也想出现在这里?联系我们
创客主机

HTML 结构

也想出现在这里?联系我们
创客主机

  1. <div class="container">
  2.     <div class="row">
  3.         <div class="col-md-12">
  4.             <div class="main-timeline">
  5.                 <div class="timeline">
  6.                     <a href="#" class="timeline-content">
  7.                         <div class="timeline-year">
  8.                             <span>2019</span>
  9.                         </div>
  10.                         <div class="timeline-icon">
  11.                             <i class="fa fa-rocket"></i>
  12.                         </div>
  13.                         <h3 class="title">Web Development</h3>
  14.                         <p class="description">
  15.                             ......
  16.                         </p>
  17.                     </a>
  18.                 </div>
  19.                 <div class="timeline">
  20.                     <a href="#" class="timeline-content">
  21.                         <div class="timeline-year">
  22.                             <span>2018</span>
  23.                         </div>
  24.                         <div class="timeline-icon">
  25.                             <i class="fa fa-globe"></i>
  26.                         </div>
  27.                         <h3 class="title">Web Designing</h3>
  28.                         <p class="description">
  29.                             ......
  30.                         </p>
  31.                     </a>
  32.                 </div>
  33.             </div>
  34.         </div>
  35.     </div>
  36. </div>

CSS 样式

  1. .main-timeline{ font-family: 'Roboto', sans-serif; }
  2. .main-timeline:after{
  3.     content: '';
  4.     display: block;
  5.     clear: both;
  6. }
  7. .main-timeline:before{
  8.     content: '';
  9.     height: 100%;
  10.     width: 2px;
  11.     border: 2px dashed #000;
  12.     transform: translateX(-50%);
  13.     position: absolute;
  14.     left: 50%;
  15.     top: 30px;
  16. }
  17. .main-timeline .timeline{
  18.     width: 50%;
  19.     padding: 100px 70px 0 25px;
  20.     margin: 0 50px 0 0;
  21.     float: left;
  22.     position: relative;
  23. }
  24. .main-timeline .timeline-content{
  25.     padding: 15px 15px 15px 40px;
  26.     border: 2px solid #00A79B;
  27.     border-radius: 15px 0 15px 15px;
  28.     display: block;
  29.     position: relative;
  30. }
  31. .main-timeline .timeline-content:hover{ text-decoration: none; }
  32. .main-timeline .timeline-content:after{
  33.     content: '';
  34.     background-color: #00A79B;
  35.     height: 18px;
  36.     width: 15px;
  37.     position: absolute;
  38.     right: -15px;
  39.     top: -2px;
  40.     clip-path: polygon(100% 0, 0 0, 0 100%);
  41. }
  42. .main-timeline .timeline-year{
  43.     color: #fff;
  44.     background-color: #00A79B;
  45.     font-size: 32px;
  46.     font-weight: 900;
  47.     text-align: center;
  48.     line-height: 98px;
  49.     height: 100px;
  50.     width: 100px;
  51.     border-radius: 50%;
  52.     position: absolute;
  53.     right: -120px;
  54.     top:-85px;
  55. }
  56. .main-timeline .timeline-year:after{
  57.     content: '';
  58.     height: 130px;
  59.     width: 130px;
  60.     border: 8px solid #00A79B;
  61.     border-left-color: transparent;
  62.     border-radius: 50%;
  63.     transform: translateX(-50%) translateY(-50%) rotate(-20deg);
  64.     position: absolute;
  65.     left: 50%;
  66.     top: 50%;
  67. }
  68. .main-timeline .timeline-icon{
  69.     color: #fff;
  70.     background-color: #00A79B;
  71.     font-size: 35px;
  72.     text-align: center;
  73.     line-height: 50px;
  74.     height: 50px;
  75.     width: 50px;
  76.     border-radius: 50%;
  77.     transform: translateY(-50%);
  78.     position: absolute;
  79.     top: 50%;
  80.     left: -25px;
  81.     transition: all 0.3s;
  82. }
  83. .main-timeline .title{
  84.     color: #222;
  85.     font-size: 20px;
  86.     font-weight: 900;
  87.     text-transform: uppercase;
  88.     letter-spacing: 1px;
  89.     margin: 0 0 7px 0;
  90. }
  91. .main-timeline .description{
  92.     color: #222;
  93.     font-size: 15px;
  94.     letter-spacing: 1px;
  95.     text-align: justify;
  96.     margin: 0 0 5px;
  97. }
  98. .main-timeline .timeline:nth-child(even){
  99.     padding: 100px 25px 0 70px;
  100.     margin: 0 0 0 50px;
  101.     float: right;
  102. }
  103. .main-timeline .timeline:nth-child(even) .timeline-content{
  104.     padding: 15px 40px 15px 15px;
  105.     border-radius: 0 15px 15px 15px;
  106. }
  107. .main-timeline .timeline:nth-child(even) .timeline-content:after{
  108.     transform: rotateY(180deg);
  109.     right: auto;
  110.     left: -15px;
  111. }
  112. .main-timeline .timeline:nth-child(even) .timeline-year{
  113.     right: auto;
  114.     left: -120px;
  115. }
  116. .main-timeline .timeline:nth-child(even) .timeline-year:after{
  117.     transform: translateX(-50%) translateY(-50%) rotate(200deg);
  118. }
  119. .main-timeline .timeline:nth-child(even) .timeline-icon{
  120.     left: auto;
  121.     right: -25px;
  122. }
  123. .timeline:nth-child(4n+2) .timeline-content,
  124. .timeline:nth-child(4n+2) .timeline-year:after{
  125.     border-color: #9E005D;
  126. }
  127. .timeline:nth-child(4n+2) .timeline-year:after{ border-left-color: transparent; }
  128. .timeline:nth-child(4n+2) .timeline-content:after,
  129. .timeline:nth-child(4n+2) .timeline-icon,
  130. .timeline:nth-child(4n+2) .timeline-year{
  131.     background-color: #9E005D;
  132. }
  133. .timeline:nth-child(4n+3) .timeline-content,
  134. .timeline:nth-child(4n+3) .timeline-year:after{
  135.     border-color: #f24f0e;
  136. }
  137. .timeline:nth-child(4n+3) .timeline-year:after{ border-left-color: transparent; }
  138. .timeline:nth-child(4n+3) .timeline-content:after,
  139. .timeline:nth-child(4n+3) .timeline-icon,
  140. .timeline:nth-child(4n+3) .timeline-year{
  141.     background-color: #f24f0e;
  142. }
  143. .timeline:nth-child(4n+4) .timeline-content,
  144. .timeline:nth-child(4n+4) .timeline-year:after{
  145.     border-color: #0870C5;
  146. }
  147. .timeline:nth-child(4n+4) .timeline-year:after{ border-left-color: transparent; }
  148. .timeline:nth-child(4n+4) .timeline-content:after,
  149. .timeline:nth-child(4n+4) .timeline-icon,
  150. .timeline:nth-child(4n+4) .timeline-year{
  151.     background-color: #0870C5;
  152. }
  153. @media screen and (max-width:767px){
  154.     .main-timeline:before{ display: none; }
  155.     .main-timeline .timeline{
  156.         width: 100%;
  157.         padding-top: 80px;
  158.         padding-right: 12px;
  159.         margin-bottom: 20px;
  160.     }
  161.     .main-timeline .timeline:nth-child(even){
  162.         padding-left: 10px;
  163.         padding-top: 80px;
  164.         margin-bottom: 20px;
  165.     }
  166.     .main-timeline .timeline-content,
  167.     .main-timeline .main-timeline .timeline:nth-child(even) .timeline-content{
  168.         background-color: #fff;
  169.         padding-top: 25px;
  170.     }
  171.     .main-timeline .timeline-content:after{ display: none; }
  172.     .main-timeline .timeline-year{
  173.         font-size: 24px;
  174.         line-height: 70px;
  175.         height: 70px;
  176.         width: 70px;
  177.         right: 0;
  178.         top: -65px;
  179.     }
  180.     .main-timeline .timeline-year:after{ display: none; }
  181.     .main-timeline .timeline:nth-child(even) .timeline-year{ left: 3px; }
  182. }
  183. @media screen and (max-width:567px){
  184.     .main-timeline .title{ font-size: 18px; }
  185. }
服务范围 1、专业提供WordPress主题、插件汉化、优化、PHP环境配置等服务请详询在线客服
2、本站承接 WordPress、DedeCMS、ThinkPHP 等系统建站、仿站、开发、定制等服务
3、英文模板(主题)安装费用为120元/次,汉化主题首次免费安装(二次安装30元/次)
售后时间 周一至周五(法定节假日除外) 10:00-22:00
免责声明 本站所提供的模板(主题/插件)等资源仅供学习交流,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担,有部分资源为网上收集或仿制而来,若模板侵犯了您的合法权益,请来信通知我们(Email: 2107117185@qq.com),我们会及时删除,给您带来的不便,我们深表歉意!
免费下载
(0)

本文由 创客云 作者:PetitQ 发表,转载请注明来源!

也想出现在这里?联系我们
创客主机

热评文章

发表评论

精彩推荐

Tabula - 艺术音乐外语培训学校网站WordPress模板

Envato Affiliates

本站承接 WordPress / DedeCMS / ThinkPHP 等
系统建站、仿站、开发、定制等业务!

Hi, 如果您有主题插件代购(30-600元)汉化等建站相关业务,可以 跟我联系 哦!
欢迎投稿
嘿,欢迎咨询!