CSS3垂直时间轴创意特效插件

CSS3垂直时间轴创意特效插件

这是一款非常有创意的CSS3垂直时间轴设计效果。该垂直时间轴采用响应式设计,通过不同的颜色来区分时间点。

使用方法
HTML结构
该CSS3垂直时间轴的基本HTML结构如下:

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

CSS样式
然后通过下面的CSS样式来构建垂直时间轴效果。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
.main-timeline{
    padding: 150px 0 0;
    position: relative;
    display: inline-block;
}
.main-timeline:before,
.main-timeline:after{
    content: '';
    height: 30px;
    width: 50px;
    background: #909090;
   border-radius: 50%;
    transform: translateX(-50%);
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 2;
}
.main-timeline:after{
    top: auto;
    bottom: -10px;
}
.main-timeline .timeline{
    width: 52.2%;
    float: left;
    display: block;
    position: relative;
    z-index: 1;
}
.main-timeline .timeline-content{
    color: #000;
   border-right: 50px solid #E5E5E5;
   padding: 40px 30px 20px 0;
    display: block;
    position: relative;
}
.main-timeline .timeline-content:hover{ text-decoration: none; }
.main-timeline .timeline-content:before,
.main-timeline .timeline-content:after{
    content: '';
    background-color: #00B3AD;
   height: 80px;
    width: 50px;
    border-radius: 23px;
    position: absolute;
    right: -50px;
    top: 30px;
}
.main-timeline .timeline-content:before{
    background-color: #047a74;
   height: 30px;
    border-radius: 50%;
    z-index: 1;
}
.main-timeline .title{
    color: #fff;
   background-color: #00B3AD;
   font-weight: 800;
    font-size: 20px;
    padding: 10px 25px;
    margin: 0 0 35px 0;
    -webkit-clip-path: polygon(95% 0, 100% 50%, 95% 100%, 0 100%, 0 0);
    clip-path: polygon(95% 0, 100% 50%, 95% 100%, 0 100%, 0 0);
}
.main-timeline .inner-content{
    padding-right: 150px;
    position: relative;
}
.main-timeline .timeline-icon{
    color: #fff;
   background-color: #00B3AD;
   font-size: 60px;
    text-align: center;
    line-height: 100px;
    height: 100px;
    width: 100px;
    border-radius: 50%;
    position: absolute;
    right: 0;
    top: 5px;
}
.main-timeline .description{
    font-size: 14px;
    text-align: justify;
    letter-spacing: 1px;
}
.main-timeline .timeline:nth-child(odd){ margin-top: -12%; }
.main-timeline .timeline:nth-child(even){
    float: right;
    width: 52.15%;
    margin-top: -12%;
}
.main-timeline .timeline:nth-child(even) .timeline-content{
    border-right: 0 solid transparent;
    border-left: 50px solid #E5E5E5;
   padding: 40px 0 20px 30px;
}
.main-timeline .timeline:nth-child(even) .timeline-content:before,
.main-timeline .timeline:nth-child(even) .timeline-content:after{
    right: auto;
    left: -50px;
}
.main-timeline .timeline:nth-child(even) .inner-content{
    padding-right: 0;
    padding-left: 150px;
}
.main-timeline .timeline:nth-child(even) .title{
    padding: 10px 25px 10px 40px;
    -webkit-clip-path: polygon(5% 0, 100% 0, 100% 100%, 5% 100%, 0 50%);
    clip-path: polygon(5% 0, 100% 0, 100% 100%, 5% 100%, 0 50%);
}
.main-timeline .timeline:nth-child(even) .timeline-icon{
    right: auto;
    left: 0;
}
.main-timeline .timeline:nth-child(4n+2) .timeline-icon,
.main-timeline .timeline:nth-child(4n+2) .title,
.main-timeline .timeline:nth-child(4n+2) .timeline-content:after{
    background-color: #FF534F;
}
.main-timeline .timeline:nth-child(4n+2) .timeline-content:before{
    background-color: #a02724;
}
.main-timeline .timeline:nth-child(4n+3) .timeline-icon,
.main-timeline .timeline:nth-child(4n+3) .title,
.main-timeline .timeline:nth-child(4n+3) .timeline-content:after{
    background-color: #9642A4;
}
.main-timeline .timeline:nth-child(4n+3) .timeline-content:before{
    background-color: #6d167c;
}
.main-timeline .timeline:nth-child(4n+4) .timeline-icon,
.main-timeline .timeline:nth-child(4n+4) .title,
.main-timeline .timeline:nth-child(4n+4) .timeline-content:after{
    background-color: #FAB030;
}
.main-timeline .timeline:nth-child(4n+4) .timeline-content:before{
    background-color: #ba7807;
}
@media screen and (max-width:1200px){
    .main-timeline{ padding: 130px 0 0; }
    .main-timeline .timeline{ width: 52.66%; }
    .main-timeline .timeline:nth-child(even){ width: 52.66%; }
}
@media screen and (max-width:990px){
    .main-timeline{ padding: 100px 0 0; }
    .main-timeline .timeline{ width: 53.5%; }
    .main-timeline .timeline:nth-child(even){ width: 53.5%; }
    .main-timeline .inner-content{
        padding-right: 120px;
    }
    .main-timeline .timeline:nth-child(even) .inner-content{
        padding-left: 120px;
    }
}
@media screen and (max-width:767px){
    .main-timeline{ padding: 17px 0 0; }
    .main-timeline:before,
    .main-timeline:after{
        transform:translateX(0);
        left: 0;
    }
    .main-timeline:after{
        top: auto;
        bottom: -10px;
    }
    .main-timeline .timeline:nth-child(odd){
        margin-top: 0;
    }
    .main-timeline .timeline,
    .main-timeline .timeline:nth-child(even){
        width: 100%;
        margin-top: 0;
        float: right;
    }
    .main-timeline .timeline .title{
        padding: 10px 25px 10px 30px;
        -webkit-clip-path: polygon(5% 0, 100% 0, 100% 100%, 5% 100%, 0 50%);
        clip-path: polygon(5% 0, 100% 0, 100% 100%, 5% 100%, 0 50%);
    }
    .main-timeline .timeline-icon{
        right: auto;
        left: 0;
    }
    .main-timeline .inner-content{
        padding-right: 0;
        padding-left: 150px;
    }
    .main-timeline .timeline-content:before,
    .main-timeline .timeline-content:after{
        right: auto;
        left: -50px;
    }
    .main-timeline .timeline-content{
        border-right: 0 solid transparent;
        border-left: 50px solid #E5E5E5;
       padding: 40px 0 20px 30px;
    }
}
@media screen and (max-width:479px){
    .main-timeline .timeline .title,
    .main-timeline .timeline:nth-child(even) .title{
        font-size: 16px;
        padding: 10px 5px 10px 25px;
    }
    .main-timeline .timeline:nth-child(even) .inner-content,
    .main-timeline .inner-content{
        padding-right: 0;
        padding-left: 15px;
    }
    .main-timeline .timeline:nth-child(even) .timeline-icon,
    .main-timeline .timeline-icon{
        transform:scale(0.7);
        right: auto;
        left: -107px;
    }
}

文件信息:

    1

    发表评论