html5时间轴,bootstrap时间轴样式,css时间轴

找了一个比较好看的bootstrap时间轴,效果如下:


微信截图_20210823210039.png

代码:

需要引入bootstrap和awesome字体

<link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css" />
<link href="/static/blog/css/font-awesome.min.css" rel="stylesheet">



<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>炫酷纯CSS3响应式垂直时间轴特效</title>
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css" />
    <link href="/static/blog/css/font-awesome.min.css" rel="stylesheet">

    <style type="text/css">
        .demobackground#e7e7e7padding1.5em 0}
        .main-timeline{
            position: relative;
            -webkit-transition: all 0.4s ease 0s;
            -moz-transition: all 0.4s ease 0s;
            -ms-transition: all 0.4s ease 0s;
            transition: all 0.4s ease 0s;
        }
        .main-timeline:before{
            content: "";
            width3px;
            height100%;
            background#1abc9c;
            position: absolute;
            top0;
            left50%;
        }
        .main-timeline .timeline{
            margin-bottom50px;
            position: relative;
        }
        .main-timeline .timeline:before,
        .main-timeline .timeline:after{
            content: "";
            display: block;
            width100%;
            clear: both;
        }
        .main-timeline .timeline-icon{
            width50px;
            height50px;
            border-radius50%;
            background#1abc9c;
            overflow: hidden;
            margin-left: -23px;
            position: absolute;
            top0;
            left50%;
            text-align: center;
        }
        .main-timeline .timeline-icon i{
            font-size30px;
            line-height50px;
            color#fff;
        }
        .main-timeline .timeline-content{
            width45%;
            padding20px;
            border-radius5px;
            background#fff;
            -webkit-box-shadow0 3px 0 rgba(0000.1);
            -moz-box-shadow0 3px 0 rgba(0000.1);
            -ms-box-shadow0 3px 0 rgba(0000.1);
            box-shadow0 3px 0 rgba(0000.1);
            -webkit-transition: all 0.3s ease 0s;
            -moz-transition: all 0.3s ease 0s;
            -ms-transition: all 0.3s ease 0s;
            transition: all 0.3s ease 0s;
        }
        .main-timeline .timeline-content:before{
            content: "";
            border-left7px solid #1abc9c;
            border-top7px solid transparent;
            border-bottom7px solid transparent;
            position: absolute;
            left45%;
            top20px;
        }
        .main-timeline .title{
            font-size30px;
            font-weight300;
            color#fff;
            padding10px;
            background#1abc9c;
            border-radius3px 3px 0 0;
            margin: -20px -20px 10px;
        }
        .main-timeline .description{
            font-size14px;
            color#726f77;
        }
        .main-timeline .read-more{
            display: inline-block;
            font-size12px;
            color#64d8c1;
            text-transform: uppercase;
            padding5px 15px;
            border2px solid #64d8c1;
            position: relative;
            border-radius5px;
            -webkit-box-shadow2px 2px 0 #64d8c1;
            -moz-box-shadow2px 2px 0 #64d8c1;
            -ms-box-shadow2px 2px 0 #64d8c1;
            box-shadow2px 2px 0 #64d8c1;
        }
        .main-timeline .read-more:hover{
            top2px;
            left2px;
            box-shadow: none;
        }
        .main-timeline .timeline-content.right{
            float: right;
        }
        .main-timeline .timeline-content.right:before{
            content: "";
            right45%;
            left: inherit;
            border-left0;
            border-right7px solid #1abc9c;
        }
        @media only screen and (max-width990px){
            .main-timeline .title{
                font-size25px;
            }
            .main-timeline .timeline-content::before{
                top16px;
            }
        }
        @media only screen and (max-width767px){
            .main-timelinemargin-left20px; }
            .main-timeline:before{ left: 0; }
            .main-timeline .timeline-content{
                width90%;
                float: right;
            }
            .main-timeline .timeline-content:before,
            .main-timeline .timeline-content.right:before{
                left: 10%;
                right: inherit;
                margin-left: -6px;
                border-left0;
                border-right7px solid #1abc9c;
            }
            .main-timeline .timeline-icon{
                left0;
            }
        }
        @media only screen and (max-width479px){
            .main-timeline .timeline-content{
                width85%;
            }
            .main-timeline .timeline-content:before,
            .main-timeline .timeline-content.right:before{
                left: 15%;
            }
            .main-timeline .title{
                font-size20px;
            }
            .main-timeline .timeline-content:before{
                top: 13px;
            }
        }
    </style>
</head>
<body>
<div class="htmleaf-container">

    <div class="demo">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="main-timeline">
                        <div class="timeline">
                            <div class="timeline-icon">
                                <i class="fa fa-star"></i>
                            </div>
                            <div class="timeline-content">
                                <h2 class="title">Web Design</h2>
                                <p class="description">
                                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent euismod fringilla nibh, feugiat pretium velit. Integer elit urna, maximus vitae rutrum hendrerit, pretium sed massa.
                                </p>
                                <a href="#" class="read-more">read more</a>
                            </div>
                        </div>

                        <div class="timeline">
                            <div class="timeline-icon">
                                <i class="fa fa-star"></i>
                            </div>
                            <div class="timeline-content right">
                                <h2 class="title">Web Development</h2>
                                <p class="description">
                                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent euismod fringilla nibh, feugiat pretium velit. Integer elit urna, maximus vitae rutrum hendrerit, pretium sed massa.
                                </p>
                                <a href="#" class="read-more">read more</a>
                            </div>
                        </div>

                        <div class="timeline">
                            <div class="timeline-icon">
                                <i class="fa fa-star"></i>
                            </div>
                            <div class="timeline-content">
                                <h2 class="title">Brand Building</h2>
                                <p class="description">
                                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent euismod fringilla nibh, feugiat pretium velit. Integer elit urna, maximus vitae rutrum hendrerit, pretium sed massa.
                                </p>
                                <a href="#" class="read-more">read more</a>
                            </div>
                        </div>

                        <div class="timeline">
                            <div class="timeline-icon">
                                <i class="fa fa-star"></i>
                            </div>
                            <div class="timeline-content right">
                                <h2 class="title">Responsive Design</h2>
                                <p class="description">
                                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent euismod fringilla nibh, feugiat pretium velit. Integer elit urna, maximus vitae rutrum hendrerit, pretium sed massa.
                                </p>
                                <a href="#" class="read-more">read more</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>


评论/留言