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.

            
              <!DOCTYPE Html>
<html>
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<link rel="stylesheet" href="responsiveTimelineStyle.css" />
	<title>Responsive Vertical Timeline</title>
</head>
<body>
	<h1>Responsive Vertical Timeline</h1>
	<h4>(Three viewports)</h4>
	<div class="timeline">
		<ul>
			<li>
				<div class="content">
					<h3 id="heading1">Heading 1</h3>
					<p>This is paragraph 1. It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. </p>
				</div>
				<div class="next">
					<h4><a href="#heading2">To step 2</a></h4>
				</div>
			</li>
			<li>
				<div class="content">
					<h3 id="heading2">Heading 2</h3>
					<p>This is paragraph 2. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters.</p>
				</div>
				<div class="next">
					<h4><a href="#heading3">To step 3</a></h4>
				</div>
			</li>
			<li>
				<div class="content">
					<h3 id="heading3">Heading 3</h3>
					<p>This is paragraph 3. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. </p>
				</div>
				<div class="next">
					<h4><a href="#heading4">To step 4</a></h4>
				</div>
			</li>
			<li>
				<div class="content">
					<h3 id="heading4">Heading 4</h3>
					<p>This is paragraph 4. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour,</p>
				</div>
				<div class="next">
					<h4><a href="#heading5">To step 5</a></h4>
				</div>
			</li>
			<li>
				<div class="content">
					<h3 id="heading5">Heading 5</h3>
					<p>This is paragraph 5. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
				</div>
				<div class="next">
					<h4><a href="#heading6">To step 6</a></h4>
				</div>
			</li>
			<li>
				<div class="content">
					<h3 id="heading6">Heading 6</h3>
					<p>This is paragraph 6. Contrary to popular belief, Lorem Ipsum is not simply random text. </p>
				</div>
				<div class="next">
					<h4><a href="#heading7">To step 7</a></h4>
				</div>
			</li>
			<li>
				<div class="content">
					<h3 id="heading7">Heading 7</h3>
					<p>This is paragraph 7. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.</p>
				</div>
				<div class="next">
					<h4><a href="#heading1">To step 1</a></h4>
				</div>
			</li>
			<div style="clear:both;"></div>
		</ul>
	</div>
</body>
</html>
            
          
!
            
              /*responsive timeline css */

/* CSS Reset*/
html{height:100%;}
*, *:before, *:after{
	padding:0;
	margin:0;
	box-sizing: border-box;
	vertical-align:baseline;
	text-decoration:none;
	list-style:none;
	font-family: arial, sans-serif;
}

/* overall heading*/
h1{text-align:center;margin-top:50px;}
h4{text-align:center;}

/*set up size of the whole timeline */
.timeline{
	position: relative;
	margin: 20px auto;
	width:1000px;
	padding:40px 0;
}

/*drawing the line itself */
.timeline:before{
	content:'';
	position:absolute;
	left:50%;
	width:2px;
	height:100%;
	background-color:grey;
}

.timeline ul {
	margin:0;
}

/*styling the size of each step/content */
.timeline ul li{
	line-height:normal;
	position:relative;
	width:50%;
	padding:20px 40px;
}

/*for every odd numbered bullet point, align to the left*/
.timeline ul li:nth-child(odd){
	text-align:right;
	float:left;
	clear:both; /*each step doesn't overlap the other vertically */
}

/* for every even numbered bullet point, align to the right */
.timeline ul li:nth-child(even){
	text-align:left;
	float:right;
	clear:both; /*each step doesn't overlap the other vertically */
}

/*create circle icon on the timeline from the left (odd) */
.timeline ul li:before {
	content:'';
	position:absolute;
	width:40px;
	height:40px;
	background-color:#1abc9c;
	border-radius:50%;
	box-shadow: 0 0 0 6px rgba(26, 188, 156,0.4);
}

/*position the circle icons on the timeline*/
.timeline ul li:nth-child(even):before{
	left:-18px;
}

.timeline ul li:nth-child(odd):before{
	right:-22px;
}

/* assign numbering*/
.timeline ul li:nth-child(1):before{content:'1';}
.timeline ul li:nth-child(2):before{content:'2';}
.timeline ul li:nth-child(3):before{content:'3';}
.timeline ul li:nth-child(4):before{content:'4';}
.timeline ul li:nth-child(5):before{content:'5';}
.timeline ul li:nth-child(6):before{content:'6';}
.timeline ul li:nth-child(7):before{content:'7';}

/*styling the numbering. Can't position at the moment */
.timeline ul li:before{
	font-weight:900;
	font-size:1.8em;
	color:white;
	text-align:center;
}

.content{
	padding-bottom:10px;
}

.content h3{
	font-weight:900;
	color:#16a085;
}

.content p{
	margin-top:10px;
	font-size:0.86em;
	line-height:1.6em;
}

/*styling all to next step links*/
.timeline ul li > .next{
	background:#f1c40f;
	position:absolute;
	border-radius:16px;
	box-shadow: 0 0 0 3px rgba(241, 196, 15,0.5);
	padding:6px 12px;
}

.next > h4 > a:link, .next > h4 > a:visited {color:white;}

.timeline ul li > .next:hover{background:#f39c12;}

/*positioning the next step links depending on which side*/
.timeline ul li:nth-child(odd) > .next{
	top:16px;
	right:-130px;
}

.timeline ul li:nth-child(even) > .next{
	top:16px;
	left:-130px;}


@media  (max-width: 1000px){
	.timeline{
		width:100%;
	}

	.content h3{
		font-size:1.8em;
	}
	.content p {
		font-size:1.2em;
	}
}
@media  (max-width: 767px){
	.timeline{
		width:100%;
		padding-bottom:0;
	}
	.timeline:before{
		left:30px;
	}
	.timeline li:nth-child(even), .timeline li:nth-child(odd) {
		width:100%;
	}
	.content {
		top:20px;
		text-align:left;
		padding-left:50px;
		padding-bottom:50px;
	}
	.timeline ul li:nth-child(odd):before, 	.timeline ul li:nth-child(even):before{
		left:14px;
	}

	.timeline ul li:nth-child(odd) .next, .timeline ul li:nth-child(even) .next{
		left:90px;
		top:-30px;
    
    /* not sure why this works */
		right:inherit;
	}
}

            
          
!
            
              /****Responsive Vertical Timeline ****/

/* used tutorial as reference (to relink) */

/* Key Lessons */
/* :nth-child() selector 
/* Relative positionign center, use margin: 0 auto; Positive positioning center, use left:50%, top:50%, transform: translate(-50%, -50%); */
/* call elements by hierarchy instead of just by class name */ 

/* unresolved: aligning the numbers */
            
          
!
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