css布局实现响应式自适应垂直时间轴效果代码
代码语言:html
所属分类:布局界面
代码描述:css布局实现响应式自适应垂直时间轴效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>时间轴</title>
<style>
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font: normal 16px/1.5 'Titillium Web', sans-serif;
background: linear-gradient(54deg, #9164ff, #8bfff4);
color: #3c3f64;
overflow-x: hidden;
padding-bottom: 50px;
}
.timeline ul li {
list-style-type: none;
position: relative;
width: 6px;
margin: 0 auto;
padding-top: 50px;
background: #fff;
}
.timeline ul li::after {
content: '';
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%) rotate(45deg);
width: 20px;
height: 20px;
z-index: 2;
background: #eee;
}
.timeline ul li div {
position: relative;
bottom: 0;
width: 400px;
padding: 20px;
background: #fff;
box-shadow: 4px 13px 30px 1px rgba(252, 56, 56, 0.2);
border-radius: 5px;
display: flex;
align-items: center;
}
.timeline ul li div time {
position: absolute;
background: #f5af19;
width: 80px;
height: 30px;
top: -15px;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
letter-spacing: 2px;
}
.timeline ul li div div {
height: 100px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.timeline ul li div div p {
text-align: center;
}
.timeline ul li div .discovery {
margin-right: 10px;
}
.timeline ul li:nth-of-type(odd) > div {
left: 45px;
}
.timeline ul li:nth-of-type(even) > div {
left: -439px;
}
.timeline ul li div {
visibility: hidden;
opacity: 0;
transition: all 0.5s ease-in-out;
}
.time.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0