Skip to content

Instantly share code, notes, and snippets.

@dziudek
Created May 22, 2012 17:52
Show Gist options
  • Save dziudek/2770571 to your computer and use it in GitHub Desktop.
Save dziudek/2770571 to your computer and use it in GitHub Desktop.
CSS Timeline
/**
* CSS Timeline
*/
body {
font-family: Arial, sans-serif;
}
.timeline {
border: 1px solid #eee;
margin: 50px auto;
width: 300px;
overflow: hidden;
padding: 20px;
position: relative;
text-align: center;
}
.timeline:before {
background: #aaa;
content: "";
display: block;
height: 100%;
left: 50%;
margin: 0 0 0 -2px;
position: absolute;
width: 4px;
z-index: 1;
}
.timeline strong {
background: #fff;
border: 1px solid #ccc;
border-radius: 3px;
display: inline-block;
padding: 3px 5px;
position: relative;
z-index: 2;
}
.timeline em {
display: inline-table;
margin: 50px 50% 0 50%;
text-align: left;
border: 1px solid #000;
position: relative;
left: 15px;
white-space: nowrap;
}
.timeline em.left {
margin: 50px 50% 0 auto;
left: 15px;
}
<div class="timeline">
<strong>Important</strong>
<em class="left">Note 1 Lorem ipsum dolor</em>
<em class="right">Note 2 lorem ip</em>
</div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment