Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <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>

<!-- extra -->
<div class="copyright">
	<p>
		Me On:
		<a href="https://www.upwork.com/o/profiles/users/_~0195eb53c731b0e159/" target="_blank" class="upwork">UpWork</a>
		<a href="https://www.fiverr.com/thenahidul" target="_blank" class="fiverr">Fiverr</a>
	</p>
</div>
              
            
!

CSS

              
                * {
	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);
	}

}


/* extra */
.copyright {
	text-align: center;
	margin-top: 50px;
	font-size: 1.6rem;
	background-color: #ddd;
}
.copyright a {
	display: inline-block;
	padding: 10px 2px;
}
.upwork {
	color: #37a000;
}
.upwork:after {
	content: '/';
	margin-left: 10px;
}
.fiverr {
	color: #1dbf73;
}
              
            
!

JS

              
                
              
            
!
999px

Console