css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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/xPrbJj" target="_blank" class="another">Another Version</a>
<a href="https://codepen.io/nahidul/pen/MryEYG?editors=1000" target="_blank" class="another">Another Version</a>

<div class="timeline-wrapper">
		<ul class="timelin-main">
			<li>
				<div>
					<h2>John Doe</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Id, excepturi corrupti velit?</p>
				</div>
			</li>
			<li>
				<div>
					<h2>John Doe</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas fugit facere delectus!</p>
				</div>
			</li>
			<li>
				<div>
					<h2>John Doe</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nemo placeat hic nam.</p>
				</div>
			</li>
			<li>
				<div>
					<h2>John Doe</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente necessitatibus iste est!</p>
				</div>
			</li>
			<li>
				<div>
					<h2>John Doe</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda accusantium quae, delectus.</p>
				</div>
			</li>
			<li>
				<div>
					<h2>John Doe</h2>
					<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias dolorum, quisquam facere.</p>
				</div>
			</li>
		</ul>
	</div>
            
          
!
            
              * {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
.another {
	margin-top: -30px;
	margin-bottom: 30px;
	display: block;
	font-size: 20px;
}

body {
	font-family: 'Open Sans', sans-serif;
	margin: 0 auto;
	padding: 50px;
	font-size: 15px;
	line-height: 1.6;
	background-color: #eee;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

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

/*TIMELINE STARTS*/
.timeline-wrapper,
.timelin-main,
.timelin-main li {
	position: relative;
}

.timelin-main {
	padding: 60px 0;
}

.timeline-wrapper:before,
.timeline-wrapper:after {
	z-index: 4;
}

/*main top circle*/
.timeline-wrapper:before {
	top: 0;
}

/*main bottom circle*/
.timeline-wrapper:after {
	bottom: 0;
}

/*main vertical line*/
.timelin-main:before {
	top: 0;
	bottom: 0;
	width: 5px;
	z-index: 3;
}

/*news post - left right left right*/
.timelin-main li > div {
	width: 35%;
	padding: 15px 30px;
	border-radius: 5px;
	border: 1px solid rgb(9, 111, 183);
	background-color: rgb(25, 141, 224);
	position: relative;
	z-index: 9;
	box-shadow: 0px 0px 3px 0px rgb(46, 152, 228);
	color: white;
}

/*left*/
.timelin-main li:nth-child(odd) > div {
	float: left;
}

/*right*/
.timelin-main li:nth-child(even) > div {
	float: right;
}

.timelin-main li:nth-child(even) {
	margin-top: 100px;
}

/*clearing float*/
.timelin-main li:after {
	content: '';
	display: block;
	clear: both;
}

/*left news line*/
.timelin-main li:nth-child(odd) > div:after {
	left: 100%;
	-webkit-transform-origin: left center;
			transform-origin: left center;
}

/*right news line*/
.timelin-main li:nth-child(even) > div:after {
	right: 100%;
	-webkit-transform-origin: right center;
			transform-origin: right center;
}

/*horizontal line of news elements - depending on the li div width*/
.timelin-main li > div:after {
	width: 44.5%;
	height: 5px;
}

/*color of lines and circles - combined */
.timeline-wrapper:before,
.timeline-wrapper:after,
.timelin-main:before,
.timelin-main li:before,
.timelin-main li > div:after,
.timelin-main li > div:before  {
	content: '';
	position: absolute;
	background-image: -webkit-repeating-linear-gradient( 
		315deg, rgb(20, 106, 195), 
		rgba(12, 28, 228, 0.97) 25%, 
		rgba(13, 234, 163, 0.98) 25%, 
		rgba(39, 86, 193, 0.38) 50% );
	background-image: repeating-linear-gradient( 
		135deg, rgb(20, 106, 195), 
		rgba(12, 28, 228, 0.97) 25%, 
		rgba(13, 234, 163, 0.98) 25%, 
		rgba(39, 86, 193, 0.38) 50% );
	background-size: 12px 12px;
}

/*circle style*/
.timeline-wrapper:before,
.timeline-wrapper:after,
.timelin-main li:before,
.timelin-main li > div:before  {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0px 0px 0px 2px rgba(0, 144, 247, 1);
	background: rgba(0, 144, 247, 1);
}

/*make sure the main line and main circles remain horizontally centered*/
.timeline-wrapper:before,
.timeline-wrapper:after,
.timelin-main:before {
	left: 50%;
	-webkit-transform: translateX(-50%);
			transform: translateX(-50%);
}

/*make sure the other lines and other circles remain vertically centered*/
.timelin-main li > div:after,
.timelin-main li > div:before  {
	top: 50%;
	-webkit-transform: translateY(-50%);
			transform: translateY(-50%);
}

/*circles on the main line*/
.timelin-main li:before {
	top: 50%;
	left: 50%;
	z-index: 10;
	-webkit-transform: translate(-50%, -50%);
			transform: translate(-50%, -50%);
/* 	background-color: red; // check which one */
}

.timelin-main li:nth-child(odd):before {
	margin-top: 23px;
}

.timelin-main li:nth-child(even):before {
	margin-top: -24px;
}

/*rotate the horizontal line*/
.timelin-main li > div:after {
	-webkit-transform: translateY(-50%) rotate(10deg);
			transform: translateY(-50%) rotate(10deg);
}

/*circle new element*/
.timelin-main li > div:before {
	right: 0;
	z-index: 3;
}

/*left news circle*/
.timelin-main li:nth-child(odd) > div:before {
	right: -7px;
}

/*right news circl*/
.timelin-main li:nth-child(even) > div:before {
	left: -7px;
}

@media screen and (max-width: 767px) {

	.timelin-main {
		padding: 75px 0;
	}
	.timelin-main li > div {
		width: 100%;
		padding: 40px 10px;
		text-align: center;
		box-shadow: none;
	}
	.timelin-main li:before {
		top: 0;
		-webkit-transform: translate(-50%, 0);
				transform: translate(-50%, 0);
	}

	.timelin-main li:nth-child(odd):before,
	.timelin-main li:nth-child(even):before {
		margin-top: -7px;
	}

	.timelin-main li:nth-child(odd) > div:before,
	.timelin-main li:nth-child(even) > div:before {
		bottom: -8px;
		left: 50%;
		top: auto;
		-webkit-transform: translateX(-50%);
				transform: translateX(-50%);
		
	}
	.timelin-main li:nth-child(even) > div:before {

	}
	.timelin-main li > div:after {
		display: none;
	}

	.timelin-main li {
		margin: 65px 0;
	}
	.timelin-main li:nth-child(even) {
		margin-top: 0;
	}
	.timelin-main li:first-child {
		margin-top: 0;
	}
	.timelin-main li:last-child {
		margin-bottom: 0;
	}
}

/* Animation */
.timeline-wrapper:before,
.timeline-wrapper:after,
.timelin-main li:before,
.timelin-main li > div:before {
	-webkit-animation: scale 2s cubic-bezier(1, -0.25, 0.05, 1.67) infinite;
			animation: scale 2s cubic-bezier(1, -0.25, 0.05, 1.67) infinite;
}

@-webkit-keyframes scale {

	0% {
		box-shadow: 0px 0px 0px 2px rgba(0, 144, 247, 1);
	}

	25% {
		box-shadow: 0px 0px 0px 3px rgba(0, 144, 247, .7);
	}
	50% {
		box-shadow: 0px 0px 0px 2px rgba(0, 144, 247, .5);
	}

	75% {
		box-shadow: 0px 0px 0px 3px rgba(0, 144, 247, .3);
	}

	100% {
		box-shadow: 0px 0px 0px 2px rgba(0, 144, 247, 1);
	}

}

@keyframes scale {

	0% {
		box-shadow: 0px 0px 0px 2px rgba(0, 144, 247, 1);
	}

	25% {
		box-shadow: 0px 0px 0px 3px rgba(0, 144, 247, .7);
	}
	50% {
		box-shadow: 0px 0px 0px 2px rgba(0, 144, 247, .5);
	}

	75% {
		box-shadow: 0px 0px 0px 3px rgba(0, 144, 247, .3);
	}

	100% {
		box-shadow: 0px 0px 0px 2px rgba(0, 144, 247, 1);
	}

}
            
          
!
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.
Loading ..................

Console