123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <a href="https://codepen.io/nahidul/pen/zdxawr" target="_blank" class="another">Another Version</a>
<a href="https://codepen.io/nahidul/pen/MryEYG" target="_blank" class="another">Another Version</a>

<div class="timeline-container">
	<ul>
		<li>
			<div>
				<h2>John Doe</h2>
				<small>20th August, 2017</small>
				<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quis, quisquam perferendis? Harum, expedita quod numquam ad</p>
			</div>
		</li>
		
		<li>
			<div>
				<h2>John Doe</h2>
				<small>20th August, 2017</small>
				<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quis, quisquam perferendis? Harum, expedita quod numquam ad</p>
			</div>
		</li>
		
		<li>
			<div>
				<h2>John Doe</h2>
				<small>20th August, 2017</small>
				<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quis, quisquam perferendis? Harum, expedita quod numquam ad</p>
			</div>
		</li>
		
		<li>
			<div>
				<h2>John Doe</h2>
				<small>20th August, 2017</small>
				<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quis, quisquam perferendis? Harum, expedita quod numquam ad</p>
			</div>
		</li>
		
	</ul>
</div>
            
          
!
            
              /* Reset */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

ul {
	list-style: none;
}

.another {
	margin-top: -30px;
	margin-bottom: 30px;
	display: block;
	font-size: 20px;
}

/* General */
body {
	line-height: 1.6;
	color: #444;
	font-family: 'Ubuntu', sans-serif;
	font-size: 14px;
	padding: 35px 15px;
	letter-spacing: .02em;
}

h2 {
	font-size: 20px;
	font-weight: 400;
	margin-bottom: 5px;
}


/* Timeline */
/*===============*/

/*Combined*/
.timeline-container,
.timeline-container li {
	position: relative;
}

.timeline-container:after,
.timeline-container li:before,
.timeline-container li > div:before,
.timeline-container li:first-child div:after,
.timeline-container li:last-child div:after {
	content: '';
	position: absolute;
}

/* color */
.timeline-container li > div,
.timeline-container li:before,
.timeline-container li > div:before,
.timeline-container:after {
	background-color: #00c4cc;
}

.timeline-container:after,
.timeline-container li small,
.timeline-container li:first-child div:after,
.timeline-container li:last-child div:after {
	left: 50%;
	transform: translateX(-50%);
}

.timeline-container li small,
.timeline-container li > div:before {
	top: 50%;
	transform: translateY(-50%);
}

/*clearfix*/
.timeline-container li:after {
	clear: both;
	content:'';
	display: table;
}

.timeline-container li {
	margin: 60px 0;
}

.timeline-container li:first-child {
	margin-top: 0;
}

.timeline-container li:last-child {
	margin-bottom: 0;
}

/*timeline content*/
.timeline-container li > div {
	width: 40%;
	color: #fff;
	padding: 15px 25px;
	border-radius: 1px;
}

.timeline-container li:nth-child(odd) > div {
	float: left;
}

.timeline-container li:nth-child(even) > div {
	float: right;
}

/* Main vertical line middile */
.timeline-container:after {
	width: 2px;
	height: 100%;
	top: 0;
	bottom: 0;
}

/* date */
.timeline-container li small {
	position: absolute;
	color: #555;
	font-size: 13px;
	font-weight: 600;
	margin-left: 20px;
}

.timeline-container li:nth-child(even) small {
	margin-left: 0;
	left: auto;
	right: 50%;
	margin-right: 20px;
}

/* Square */
.timeline-container li:before {
	height: 7px;
	width: 8px;
	border: 3px solid #fff;
	z-index: 2;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

/* Horizontal line */
.timeline-container li > div:before {
	height: 2px;
	left: 40%;
	width: 10%;
}
.timeline-container li:nth-child(even) div:before {
	left: auto;
	right: 40%;
}

/* Remove the top part of main vertical line */
.timeline-container li:first-child div:after,
.timeline-container li:last-child div:after {
	width: 2px;
	top: 0;
	background-color: #fff;
	height: 50%;
	z-index: 1;
}

.timeline-container li:last-child div:after {
	top: auto;
	bottom: 0;
}


/* Responsive CSS */
@media screen and (max-width: 767px) {
	
	.timeline-container li:nth-child(odd) > div,
	.timeline-container li:nth-child(even) > div{
		float: right;
		width: 95%;
	}
	
	.timeline-container li:first-child div:after,
	.timeline-container li:last-child div:after {
		content: none;
	}
	
	.timeline-container:after,
	.timeline-container li:first-child div:after,
	.timeline-container li:last-child div:after,
	.timeline-container li:before {
		top: 0;
		left: 0;
	}
	
	.timeline-container li small,
	.timeline-container li:nth-child(even) small {
		top: 0;
		left: 3%;
		margin: 0;
		right: auto;
	}
	
	.timeline-container li {
		margin: 0;
		padding: 35px 0;
	}
	
	.timeline-container li:last-child > div:after {
		content: '';
		height: 7px;
		width: 8px;
		position: absolute;
		top: 100%;
		border: 3px solid #fff;
		z-index: 2;
		background-color: #00c4cc;
	}
	
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console