Skip to content

Instantly share code, notes, and snippets.

@monkeymonk
Created December 10, 2013 13:03
Show Gist options
  • Save monkeymonk/7890261 to your computer and use it in GitHub Desktop.
Save monkeymonk/7890261 to your computer and use it in GitHub Desktop.
Timeline Style and Structure (LESS and HTML) based on Bootstrap v3
<div class="container">
<div class="row">
<div class="col-md-12">
<h4 class="timeline-month"><span>November</span> <span>2013</span></h4>
<ul class="timeline">
<li class="timeline-orange">
<div class="timeline-icon"><i class="glyphicon glyphicon-facetime-video"></i></div>
<div class="timeline-body">
<div class="timeline-header">
<span class="author">Posted by <a href="#">David Tennant</a></span>
<span class="date">Monday, November 11, 2013</span>
</div>
<div class="timeline-content">
<h3>Lorem Ipsum Dolor Sit Amet</h3>
<p><img src="http://placehold.it/150x120" alt="" class="pull-left" />Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia, officiis, molestiae, deserunt asperiores architecto ut vel repudiandae dolore inventore nesciunt necessitatibus doloribus ratione facere consectetur suscipit! Quasi, officia, veniam mollitia recusandae iure aperiam totam culpa aut nobis eveniet porro laborum quisquam non.</p>
</div>
<div class="timeline-footer">
<a href="#" class="btn btn-default btn-sm pull-left">Read Full Story</a>
</div>
</div>
</li>
<li class="timeline-warning">
<div class="timeline-icon"><i class="glyphicon glyphicon-pencil"></i></div>
<div class="timeline-body">
<div class="timeline-header">
<span class="author">Posted by <a href="#">David Tennant</a></span>
<span class="date">Monday, November 21, 2013</span>
</div>
<div class="timeline-content">
<h3>Consectetur Adipisicing Elit</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia, officiis, molestiae, deserunt asperiores architecto ut vel repudiandae dolore inventore nesciunt necessitatibus doloribus ratione facere consectetur suscipit!</p>
</div>
</div>
</li>
</ul>
</div>
<div class="col-md-12">
<h4 class="timeline-month"><span>December</span> <span>2013</span></h4>
<ul class="timeline">
<li class="timeline-success">
<div class="timeline-icon"><i class="glyphicon glyphicon-camera"></i></div>
<div class="timeline-body">
<div class="timeline-header">
<span class="author">Posted by <a href="#">David Tennant</a></span>
<span class="date">Thursday, December 03, 2013</span>
</div>
<div class="timeline-content">
<h3>Lorem Ipsum Dolor Sit Amet</h3>
<p><img src="http://placehold.it/150x120" alt="" class="pull-left">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia, officiis, molestiae, deserunt asperiores architecto ut vel repudiandae dolore inventore nesciunt necessitatibus doloribus ratione facere consectetur suscipit! Quasi, officia, veniam mollitia recusandae iure aperiam totam culpa aut nobis eveniet porro laborum quisquam non.</p>
</div>
<div class="timeline-footer">
<a href="#" class="btn btn-default btn-sm pull-left">Read Full Story</a>
</div>
</div>
</li>
<li class="timeline-midnightblue">
<div class="timeline-icon"><i class="glyphicon glyphicon-pencil"></i></div>
<div class="timeline-body">
<div class="timeline-header">
<span class="author">Posted by <a href="#">David Tennant</a></span>
<span class="date">Thursday, December 12, 2013</span>
</div>
<div class="timeline-content">
<h3>Consectetur Adipisicing Elit</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia, officiis, molestiae, deserunt asperiores architecto ut vel repudiandae dolore inventore nesciunt necessitatibus doloribus ratione facere consectetur suscipit!</p>
</div>
</div>
</li>
</ul>
</div>
<div class="col-md-12">
<h4 class="timeline-month"><span>January</span> <span>2014</span></h4>
<ul class="timeline">
<li class="timeline-primary">
<div class="timeline-icon"><i class="glyphicon glyphicon-camera"></i></div>
<div class="timeline-body">
<div class="timeline-header">
<span class="author">Posted by <a href="#">David Tennant</a></span>
<span class="date">Thursday, January 03, 2014</span>
</div>
<div class="timeline-content">
<h3>Lorem Ipsum Dolor Sit Amet</h3>
<p><img src="http://placehold.it/150x120" alt="" class="pull-left">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia, officiis, molestiae, deserunt asperiores architecto ut vel repudiandae dolore inventore nesciunt necessitatibus doloribus ratione facere consectetur suscipit! Quasi, officia, veniam mollitia recusandae iure aperiam totam culpa aut nobis eveniet porro laborum quisquam non.</p>
</div>
<div class="timeline-footer">
<a href="#" class="btn btn-default btn-sm pull-left">Read Full Story</a>
</div>
</div>
</li>
<li class="timeline-indigo">
<div class="timeline-icon"><i class="glyphicon glyphicon-pencil"></i></div>
<div class="timeline-body">
<div class="timeline-header">
<span class="author">Posted by <a href="#">David Tennant</a></span>
<span class="date">Thursday, January 24, 2014</span>
</div>
<div class="timeline-content">
<h3>Consectetur Adipisicing Elit</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officia, officiis, molestiae, deserunt asperiores architecto ut vel repudiandae dolore inventore nesciunt necessitatibus doloribus ratione facere consectetur suscipit!</p>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
.timeline-month {
width: 90px;
text-align: center;
position: relative;
left: 6%;
margin-left: -42px;
span {
display: block;
}
}
.timeline {
padding-left: 0;
list-style: none;
position: relative;
&:before {
content: '';
position: absolute;
top: 10px;
bottom: 0;
width: 2px;
background: #e6e7e8;
left: 6%;
margin-left: 2px;
}
>li {
position: relative;
.timeline-header {
padding: 0 0 10px;
color: #aeafb1;
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
span.date {
float: left;
text-transform: uppercase;
}
span.author {
float: right;
font-size: 12px;
display: none;
}
}
.timeline-icon {
width: 50px;
height: 50px;
font-size: 1.4em;
line-height: 50px;
-webkit-font-smoothing: antialiased;
position: absolute;
color: #4d4d4d;
background: #e6e7e8;
border-radius: 50%;
text-align: center;
left: 6%;
top: 0;
margin: 0 0 0 -22px;
padding: 0;
}
.timeline-body {
margin: 0 0 20px 14%;
padding: 20px;
position: relative;
border-width: 2px;
border-style: solid;
border-radius: 2px;
background-color: #fff;
&:after {
right: 100%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: transparent;
border-width: 10px;
top: 5%;
}
img {
margin: 5px 20px 0 0;
}
}
.timeline-footer {
color: #fff;
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}
}
}
@media (max-width:991px) {
.timeline-month {
width: 100%;
text-align: center;
margin-left: 0;
left: 0;
span {
display: inline!important;
}
}
.timeline {
&:before {
width: 0;
left: 0;
}
>li {
margin-top: 20px;
&:first-child {
margin-top: 0;
}
.timeline-body {
margin: 0!important;
&:after {
border-width: 0;
}
}
.timeline-icon {
width: 30px;
height: 30px;
line-height: 30px;
font-size: 1em;
margin: 20px 50px 0 0;
position: relative;
float: right;
}
}
}
}
.timeline-primary {
.timeline-body {
border-color: #4f8edc;
&:after {
border-right-color: #4f8edc!important;
}
}
.timeline-time {
color: #4f8edc;
}
}
.timeline-warning {
.timeline-body {
border-color: #f1c40f;
&:after {
border-right-color: #f1c40f!important;
}
}
.timeline-time {
color: #f1c40f;
}
}
.timeline-danger {
.timeline-body {
border-color: #e73c3c;
&:after {
border-right-color: #e73c3c!important;
}
}
.timeline-time {
color: #e73c3c;
}
}
.timeline-success {
.timeline-body {
border-color: #85c744;
&:after {
border-right-color: #85c744!important;
}
}
.timeline-time {
color: #85c744;
}
}
.timeline-info {
.timeline-body {
border-color: #2bbce0;
&:after {
border-right-color: #2bbce0!important;
}
}
.timeline-time {
color: #2bbce0;
}
}
.timeline-inverse {
.timeline-body {
border-color: #4f5259;
&:after {
border-right-color: #4f5259!important;
}
}
.timeline-time {
color: #4f5259;
}
}
.timeline-brown {
.timeline-body {
border-color: #c0392b;
&:after {
border-right-color: #c0392b!important;
}
}
.timeline-time {
color: #c0392b;
}
}
.timeline-indigo {
.timeline-body {
border-color: #9358ac;
&:after {
border-right-color: #9358ac!important;
}
}
.timeline-time {
color: #9358ac;
}
}
.timeline-orange {
.timeline-body {
border-color: #efa131;
&:after {
border-right-color: #efa131!important;
}
}
.timeline-time {
color: #efa131;
}
}
.timeline-sky {
.timeline-body {
border-color: #76c4ed;
&:after {
border-right-color: #76c4ed!important;
}
}
.timeline-time {
color: #76c4ed;
}
}
.timeline-midnightblue {
.timeline-body {
border-color: #34495e;
&:after {
border-right-color: #34495e!important;
}
}
.timeline-time {
color: #34495e;
}
}
.timeline-magenta {
.timeline-body {
border-color: #e73c68;
&:after {
border-right-color: #e73c68!important;
}
}
.timeline-time {
color: #e73c68;
}
}
.timeline-green {
.timeline-body {
border-color: #16a085;
&:after {
border-right-color: #16a085!important;
}
}
.timeline-time {
color: #16a085;
}
}
.timeline-purple {
.timeline-body {
border-color: #e044ab;
&:after {
border-right-color: #e044ab!important;
}
}
.timeline-time {
color: #e044ab;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment