Timeline Style

from: https://freefrontend.com/css-timelines/

css:

.demo{ background: #25303b;
padding: 100px 0;}
.heading-title
{
	margin-bottom: 100px;
	color: #fff;
}
.main-timeline{
    width: 80%;
    margin: 20px auto;
    position: relative;
}

.main-timeline:before{
    content: "";
    display: block;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.2);
    margin: 0 0 0 -1px;
    position: absolute;
    top: 0;
    left: 50%;
}

.main-timeline .timeline{
    width: 100%;
    margin-bottom: 20px;
    position: relative;
}

.main-timeline .timeline:after{
    content: "";
    display: block;
    clear: both;
}

.main-timeline .timeline-content{
    width: 40%;
    float: left;
    margin: 5px 0 0 0;
    border-radius: 6px;
}

.main-timeline .date{
    display: block;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #25303b;
    padding: 5px 0;
    margin: 0 0 0 -36px;
    position: absolute;
    top: 0;
    left: 50%;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 0 7px #25303b;
}

.main-timeline .date span{
    display: block;
    text-align: center;
}

.main-timeline .day,
.main-timeline .year{
    font-size: 10px;
}

.main-timeline .month{
    font-size: 18px;
}

.main-timeline .title{
    padding: 15px;
    margin: 0;
    font-size: 20px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -1px;
    border-radius: 6px 6px 0 0;
    position: relative;
}

.main-timeline .title:after{
    content: "";
    width: 10px;
    height: 10px;
    position: absolute;
    top: 20px;
    right: -5px;
    transform: rotate(-45deg);
}

.main-timeline .description{
    padding: 15px;
    margin: 0;
    font-size: 14px;
    color: #656565;
    background: #fff;
    border-radius: 0 0 6px 6px;
}

.main-timeline .timeline:nth-child(2n+2) .timeline-content{
    float: right;
}

.main-timeline .timeline:nth-child(2n+2) .title:after{
    left: -5px;
}
/*有多少条要设置其量*/
.main-timeline .timeline:nth-child(1) .title,
.main-timeline .timeline:nth-child(1) .title:after{
    background: #9f84c4;
}

.main-timeline .timeline:nth-child(2) .title,
.main-timeline .timeline:nth-child(2) .title:after{
    background: #02a2dd;
}

.main-timeline .timeline:nth-child(3) .title,
.main-timeline .timeline:nth-child(3) .title:after{
    background: #58b25e;
}

.main-timeline .timeline:nth-child(4) .title,
.main-timeline .timeline:nth-child(4) .title:after{
    background: #efb715;
}

.main-timeline .timeline:nth-child(5) .title,
.main-timeline .timeline:nth-child(5) .title:after{
    background: #ffe218;
}

.main-timeline .timeline:nth-child(6) .title,
.main-timeline .timeline:nth-child(6) .title:after{
    background: #eab788;
}

@media only screen and (max-width: 990px){
    .main-timeline{ width: 100%; }
}

@media only screen and (max-width: 767px){
    .main-timeline:before,
    .main-timeline .date{
        left: 6%;
    }
    .main-timeline .timeline-content{
        width: 85%;
        float: right;
    }
    .main-timeline .title:after{
        left: -5px;
    }
}

@media only screen and (max-width: 480px){
    .main-timeline:before,
    .main-timeline .date{
        left: 12%;
    }
    .main-timeline .timeline-content{
        width: 75%;
    }
    .main-timeline .date{
        width: 60px;
        height: 60px;
        margin-left: -30px;
    }
    .main-timeline .month{
        font-size: 14px;
    }
}@charset "utf-8";
/* CSS Document */

  

html5:

<!DOCTYPE html>
<html lang="en">
  <head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link rel="stylesheet" href="style/style.css">
<title>Timeline Style</title>
</head>

<body>
 <div class="demo">
        <div class="container">
            <div class="row text-center">
                <h1 class="heading-title">Timeline Style</h1>
            </div>

            <div class="row">
                <div class="col-md-12">
                    <div class="main-timeline">

                        <div class="timeline">
                            <div class="timeline-content">
                                <span class="date">
                                    <span class="day">10<sup>th</sup></span>
                                    <span class="month">Apr</span>
                                    <span class="year">2017</span>
                                </span>
                                <h2 class="title">Web Design</h2>
                                <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dapibus, quam non pellentesque consequat, massa justo elementum nunc, ac efficitur tortor nunc sit amet dolor.</p>
                            </div>
                        </div>

                        <div class="timeline">
                            <div class="timeline-content">
                                <span class="date">
                                    <span class="day">12<sup>th</sup></span>
                                    <span class="month">Apr</span>
                                    <span class="year">2017</span>
                                </span>
                                <h2 class="title">Web Development</h2>
                                <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dapibus, quam non pellentesque consequat, massa justo elementum nunc, ac efficitur tortor nunc sit amet dolor.</p>
                            </div>
                        </div>

                        <div class="timeline">
                            <div class="timeline-content">
                                <span class="date">
                                    <span class="day">14<sup>th</sup></span>
                                    <span class="month">Apr</span>
                                    <span class="year">2017</span>
                                </span>
                                <h2 class="title">Brand Building</h2>
                                <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dapibus, quam non pellentesque consequat, massa justo elementum nunc, ac efficitur tortor nunc sit amet dolor.</p>
                            </div>
                        </div>

                        <div class="timeline">
                            <div class="timeline-content">
                                <span class="date">
                                    <span class="day">16<sup>th</sup></span>
                                    <span class="month">Apr</span>
                                    <span class="year">2017</span>
                                </span>
                                <h2 class="title">Responsive Design</h2>
                                <p class="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla dapibus, quam non pellentesque consequat, massa justo elementum nunc, ac efficitur tortor nunc sit amet dolor.</p>
                            </div>
                        </div>

                         <div class="timeline">
                            <div class="timeline-content">
                                <span class="date">
                                    <span class="day">28<sup>th</sup></span>
                                    <span class="month">Aug</span>
                                    <span class="year">2017</span>
                                </span>
                                <h2 class="title">中国人民解放军</h2>
                                <p class="description">生中朝右发的凯撒奖地板革最悲歌罗东进榴莲味觉得撒开了房间.</p>
                            </div>
                        </div>

                        <div class="timeline">
                            <div class="timeline-content">
                                <span class="date">
                                    <span class="day">26<sup>th</sup></span>
                                    <span class="month">Jun</span>
                                    <span class="year">2018</span>
                                </span>
                                <h2 class="title">深圳市罗湖区布心路3008号</h2>
                                <p class="description">涂聚文,昵称:Geovin Du.繁體:塗聚文,生命在于运动。营养膳食养生。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</body>
</html>

 

效果:

原文地址:https://www.cnblogs.com/geovindu/p/10287986.html

时间: 2024-10-08 13:34:54

Timeline Style的相关文章

纯css+js水平时间轴

自定义,并自动加载时间节点 当前时间节点居中,突出显示 时间动态无痕添加 效果图: 初始状态 时间左走到一定2016.1月后 html: <!-- 水平时间轴 --> <div id="timeline" style="width: 902px; height: 60px;"> <ul id="dates" style="position: absolute; right: 0; top: -10px;&q

使用Chrome DevTools的Timeline分析页面性能

随着webpage可以承载的表现形式更加多样化,通过webpage来实现更多交互功能,构建web应用程序已经成为很多产品的首要选择.这种方式拥有非常明显的优势:跨平台.开发便捷.便于部署和维护等等,但随着功能的不断积累,web应用程序也会变得越来越复杂.但是,我们仍然想要在webpage支持丰富的呈现形式的同时,让页面效果能够达到>=60fps(帧)/s的刷新频率以避免出现卡顿,就需要我们使用一些比较直观的方式来分析衡量页面的性能问题,为性能优化方案提供依据. 为什么是60fps?我们的目标是保

iOS style sliding menu

结果如下图所示: <html> <head> <script type='text/javascript' charset='utf-8' src='jquery-1.8.3.js'></script> <style type="text/css"> @import url(http://fonts.googleapis.com/css?family=Oxygen:400,700); /* Fonts */ @font-fac

js性能优化之Timeline

有时候,我们就是会不由自主地写出一些低效的代码,严重影响页面运行的效率.或者我们接手的项目中,前人写出来的代码千奇百怪,比如为了一个 Canvas 特效需要同时绘制 600 个三角形,又比如 Coding.net 的任务中心需要同时 watch 上万个变量的变化等等.那么,如果我们遇到了一个比较低效的页面,应该如何去优化它呢? 优化前的准备:知己知彼 在一切开始之前,我们先打开 F12 面板,熟悉一下我们接下来要用到的工具:Timeline: 嗯没错就是它.下面逐一介绍一下吧.区域 1 是一个缩

WPF DataGrid Custommization using Style and Template

转载:http://www.codeproject.com/Articles/586132/WPF-DataGrid-Custommization-using-Style-and-Templa WPF DataGrid Custommization using Style and Template Hiren Khirsaria, 2 May 2013 CPOL customize DataGridRowHeader, DataGridColumnHeader, DataGridCell, Da

Chrome渲染分析之Timeline工具的使用

Posted on 2014年6月27日 by admin | Leave a reply 概述 这个工具真的很强大,Timeline工具栏提供了对于在装载你的Web应用的过程中,时间花费情况的概览,这些应用包括处理DOM事件, 页面布局渲染或者向屏幕绘制元素.Timeline可以通过事件,框架,和实时内存用量3个方面的数据来监测网页,通过这些数据,我们可以方便的找出页面中存在问题的地方. Timeline面板 打开chrome开发者工具,切换到Timeline选项卡,界面如下: 功能很多,非常

echarts实现上海地域PM值(map、timeline)

<!doctype html> <html> <head> <meta charset="utf-8"> <title>echarts图形插件使用</title> <script src="jquery.min.js"></script> <script src="http://s1.bdstatic.com/r/www/cache/ecom/esl/2-

WPF教程005 - Timeline时间轴控件的实现

效果图: 由于整个控件是实现之后才写的教程,因此这里记录的代码是最终实现后的,前后会引用到其他的一些依赖属性或者代码,需要阅读整篇文章. 1.确定Timeline继承的基类 从效果图中可以看到,时间轴都是由一节一节的子节点组成的,这个很容易联想到我们应该将Timeline继承自ItemsControl.之外仔细观察效果图,可以发现第一项的时间轴节点与其他都不同,而且拆解每一个子项,发现都是由一个圆圈和一个竖线组成,但是最后一项和上面的都不同,少了一个竖线,因此为了控制这些样式,我们需要重新定义一

使用 Chrome Timeline 来优化页面性能

有时候,我们就是会不由自主地写出一些低效的代码,严重影响页面运行的效率.或者我们接手的项目中,前人写出来的代码千奇百怪,比如为了一个 Canvas 特效需要同时绘制 600 个三角形,又比如 Coding.net 的任务中心需要同时 watch 上万个变量的变化等等.那么,如果我们遇到了一个比较低效的页面,应该如何去优化它呢? 优化前的准备:知己知彼 在一切开始之前,我们先打开 F12 面板,熟悉一下我们接下来要用到的工具:Timeline: 嗯没错就是它.下面逐一介绍一下吧.区域 1 是一个缩