CSS Timeline

by dauruk0512

HTML

<div class="bar"></div>
<div class="timeline">
    <div class="entry">
        <h1>1990</h1>
      
      
    </div>
    <div class="entry">
        <h1>1995</h1>
        Here's the info about this date
    </div>
    <div class="entry">
        <h1>2000</h1>
        Here's the info about this date
    </div>
    <div class="entry">
        <h1>2005</h1>
        Here's the info about this date
    </div>
    <div class="entry">
        <h1>2010</h1>
        Here's the info about this date
    </div>
</div>

CSS

body {
    padding:25px;
    font-family:sans-serif;
}
.timeline {
    white-space:nowrap;
    overflow-x: scroll;
    padding:30px 0 10px 0;
    position:relative;
}

.entry {
    display:inline-block;
    vertical-align:top;
    background:#13519C;
    color:#fff;
    padding:10px;
    font-size:12px;
    text-align:center;
    position:relative;
    border-top:4px solid #06182E;
    border-radius:3px;
    min-width:200px;
    max-width:500px;
}

.entry img {
    display:block;
    max-width:100%;
    height:auto;
    margin-bottom:10px;
}

.entry:after {
    content:'';
    display:block;
    background:#eee;
    width:7px;
    height:7px;
    border-radius:6px;
    border:3px solid #06182E;
    position:absolute;
    left:50%;
    top:-30px;
    margin-left:-6px;
}

.entry:before {
    content:'';
    display:block;
    background:#06182E;
    width:5px;
    height:20px;
    position:absolute;
    left:50%;
    top:-20px;
    margin-left:-2px;
}

.entry h1 {
    color:#fff;
    font-size:18px;
    font-family:Georgia, serif;
    font-weight:bold;
    margin-bottom:10px;
}

.entry h2 {
    letter-spacing:.2em;
    margin-bottom:10px;
    font-size:14px;
}

.bar {
    height:4px;
    background:#eee;
    width:100%;
    position:relative;
    top:13px;
    left:0;
}