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

              
                [[[https://codepen.io/shaunrfox/pen/QwrRqM]]]

<div class="map-search-result">
	<div class="search-result-post-information">
		<a href=""class="profile-picture">
			<img src="https://pbs.twimg.com/profile_images/512265455268925441/fboeqrht_400x400.png" alt="BP" />
		</a>
		<div class="text-section">
			<a class="user-name" href="">@brendanpittman</a>
			<div class="post-metadata">
			via Twitter for Android at 2015-04-23T14:12:21Z
			</div> 
		</div>
		<a class="icon-button view-online" href="https://www.twitter.com/brendanpittman">
			<img src="http://placehold.it/30x30">
		</a>
	</div>
	
	<div class="search-result-post-content">
		<div class="main-content-wrapper has-media">
			<a href="" class="media-wrapper">
				<img src="http://shaunfox.com/assets/img/photos/2011-big-bend/big-bend-dog.jpg">
			</a>
			<div class="post-text">
				Put together a short reel from our SF trip this past weekend. <a href="https://vimeo.com/125189281">https://vimeo.com/125189281</a> <a href="https://twitter.com/brendanpittman">@brendanpittman</a> <a href="https://twitter.com/kourtneykox">@kourtneykox</a>
			</div>
		</div> 
		<div class="post-activity">
			<div class="likes-count">
				<span>25 Likes</span>
				<svg viewBox="0 0 30 30" class="ico-star">
					<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico-star"></use>
				</svg>
			</div>
			<div class="comments-count">
				<span>333 Comments</span>
				<svg viewBox="0 0 30 30" class="ico-message">
					<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico-message"></use>
				</svg>
			</div>
			<div class="likes-list">
				<div class="likes-label">Likes</div>
				<a href="https://twitter.com/brendanpittman">@brendanpittman</a>
				<a href="https://twitter.com/kourtneykox">@kourtneykox</a>
				<a href="https://twitter.com/shaunrfox">@shaunrfox</a>
				<a href="https://twitter.com/bxyoung89">@bxyoung89</a>
				<a href="https://twitter.com/bigweeble">@bigweeble</a>
			</div>
			<div class="comments-list">
				<div class="comments-label">Comments</div>
				<div class="comment">
					<div class="commenter-picture">
						<img src="http://shaunfox.com/assets/img/shaun-fox.jpg">
					</div>
					<div class="comment-information">
						<div class="commenter-name">
							<a class="user-name" href="https://twitter.com/shaunrfox">shaunrfox</a>
						</div>
						<div class="comment-time">2014-12-02T14:38:31Z</div>
						<div class="comment-text">Howdy</div>
					</div>
				</div> <!-- /.comment -->
				<div class="comment">
					<div class="commenter-picture">
						<img src="http://shaunfox.com/assets/img/shaun-fox.jpg">
					</div>
					<div class="comment-information">
						<div class="commenter-name">
							<a class="user-name" href="https://twitter.com/shaunrfox">shaunrfox</a>
						</div>
						<div class="comment-time">2014-12-02T14:38:31Z</div>
						<div class="comment-text">Hey there. Cool video. Get your brother to give me a call. #gopro #nerd</div>
					</div>
				</div> <!-- /.comment -->
				<div class="comment">
					<div class="commenter-picture">
						<img src="http://shaunfox.com/assets/img/shaun-fox.jpg">
					</div>
					<div class="comment-information">
						<div class="commenter-name">
							<a class="user-name" href="https://twitter.com/shaunrfox">shaunrfox</a>
						</div>
						<div class="comment-time">2014-12-02T14:38:31Z</div>
						<div class="comment-text">I love <a href="https://twitter.com/brittanpittman">@brittanpittman</a>'s work. </div>
					</div>
				</div> <!-- /.comment -->
				<div class="comment">
					<div class="commenter-picture">
						<img src="http://shaunfox.com/assets/img/shaun-fox.jpg">
					</div>
					<div class="comment-information">
						<div class="commenter-name">
							<a class="user-name" href="https://twitter.com/shaunrfox">shaunrfox</a>
						</div>
						<div class="comment-time">2014-12-02T14:38:31Z</div>
						<div class="comment-text">Gotta get a kinda long comment in here too. Cuz people like to write a lot sometimes. They got a lot to say and you definitely need to hear it. PS. I love <a href="https://twitter.com/brittanpittman">@brittanpittman</a>'s work. </div>
					</div>
				</div> <!-- /.comment -->
				<div class="comment">
					<div class="commenter-picture">
						<img src="http://shaunfox.com/assets/img/shaun-fox.jpg">
					</div>
					<div class="comment-information">
						<div class="commenter-name">
							<a class="user-name" href="https://twitter.com/shaunrfox">shaunrfox</a>
						</div>
						<div class="comment-time">2014-12-02T14:38:31Z</div>
						<div class="comment-text">Howdy</div>
					</div>
				</div> <!-- /.comment -->
				<div class="comment">
					<div class="commenter-picture">
						<img src="http://shaunfox.com/assets/img/shaun-fox.jpg">
					</div>
					<div class="comment-information">
						<div class="commenter-name">
							<a class="user-name" href="https://twitter.com/shaunrfox">shaunrfox</a>
						</div>
						<div class="comment-time">2014-12-02T14:38:31Z</div>
						<div class="comment-text">Hey there. Cool video. Get your brother to give me a call. #gopro #nerd</div>
					</div>
				</div> <!-- /.comment -->
				<div class="comment">
					<div class="commenter-picture">
						<img src="http://shaunfox.com/assets/img/shaun-fox.jpg">
					</div>
					<div class="comment-information">
						<div class="commenter-name">
							<a class="user-name" href="https://twitter.com/shaunrfox">shaunrfox</a>
						</div>
						<div class="comment-time">2014-12-02T14:38:31Z</div>
						<div class="comment-text">I love <a href="https://twitter.com/brittanpittman">@brittanpittman</a>'s work. </div>
					</div>
				</div> <!-- /.comment -->
				<div class="comment">
					<div class="commenter-picture">
						<img src="http://shaunfox.com/assets/img/shaun-fox.jpg">
					</div>
					<div class="comment-information">
						<div class="commenter-name">
							<a class="user-name" href="https://twitter.com/shaunrfox">shaunrfox</a>
						</div>
						<div class="comment-time">2014-12-02T14:38:31Z</div>
						<div class="comment-text">Gotta get a kinda long comment in here too. Cuz people like to write a lot sometimes. They got a lot to say and you definitely need to hear it. PS. I love <a href="https://twitter.com/brittanpittman">@brittanpittman</a>'s work. </div>
					</div>
				</div> <!-- /.comment -->
			</div>
		</div>
	</div>
	
	<footer class="post-geo-footer">
		<a class="search-results-geo-button has-geo" href="">
			<svg viewBox="0 0 30 30" class="ico-location">
				<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico-location"></use>
			</svg>
		<div class="description">View on map</div>
		</a>
		<div class="search-results-dropdown more-options-dropdown pull-right">
			<button class="icon-button" id="" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="More Options">
				<svg viewBox="0 0 30 30" class="chevron ico-arrow-down">
					<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#ico-arrow-down"></use>
				</svg>
			</button>
		</div>
	</footer>
</div>
              
            
!

CSS

              
                body {
	width: 100%;
	height: 100%;
	display: block;
	background: $off-white;
}

.map-search-result {
	position: relative;
	background: $white;
	margin: 0 10px 10px 10px;
	padding: 10px 10px 40px 10px;
	border: 1px solid $mid-grey;
	box-shadow: 2px 2px 3px rgba($off-black, .2);
	border-radius: 4px;

	&:first-of-type {
		margin-top: 10px;
	}
}
	
.search-result-post-information {
	position: relative;
	width: 100%;
	height: 40px;
	display: table;
	margin-bottom: 10px;
	
	.profile-picture {
		position: absolute;
		top: 0;
		left: 0;
		height: 50px;
		width: 50px;

		img {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
	}
	
	.text-section {
		position: absolute;
		top: 0px;
		left: 60px;
		right: 40px;
		height: 40px;
		display: block;
		vertical-align: top;
	}

	.user-name {
		float: left;
		width: auto;
		max-width: 100%;
		@include font-size(2.3);
		color: $off-black;
		display: block;
		text-decoration: none;
		@include truncate();
		border-bottom: 1px solid transparent;

		&:hover {
			cursor: pointer;
			border-color: currentColor;
		}
	}
	
	.post-metadata {
		float: left;
		clear: left;
		width: auto;
		max-width: 100%;
		@include truncate();
		@include font-size(1.2);
		color: $dark-grey;
		margin-top: 4px;
	}

	.view-online {
		display: block;
		position: absolute;
		top: 0;
		right: 0;
		width: 30px;
		height: 30px;
		margin: 0;

		img {
			width: 100%;
			height: 100%;
		}

		&:after {
			content: '';
			position: absolute;
			top: -2px;
			right: -2px;
			bottom: -2px;
			left: -2px;
			border: 2px solid transparent;
		}
 
		&:hover {
			&:after {
				border-color: $blue;
			}
		}
	}
} 

.search-result-post-content {
	width: 100%;
	padding: 10px 0 0 0;
	margin-top: 20px;
	border-top: 1px solid $light-grey;
	@include clearfix();
	
	.main-content-wrapper {
		display: table;
		border-bottom: 1px solid $off-white;
		
		&.has-media {			
			.media-wrapper { 
				width: 100px; 
				min-width: 100px;
			}
			
			.post-text { 
				padding-left: 10px; 
				@include word-wrap();
			}
		}
	}
	
	.media-wrapper {
		display: table-cell;
		position: relative;
		background-repeat: no-repeat;
		background-size: cover;
		background-position: center center;
		vertical-align: top;
		
		img {
			width: auto;
			height: auto;
			max-width: 100%;
			max-height: 100%;
			border: 2px solid transparent;
			
			&:hover {
				cursor: pointer;
				border-color: $blue; 
			}
		}
	}

	.post-text {
		display: table-cell;
		height: auto;
		@include clearfix;
		@include font-size(1.6);
		padding-bottom: 15px;
		word-wrap: break-word;
		overflow: hidden;

		a {
			color: $blue;
			text-decoration: none;
			word-wrap: break-word;
			border-bottom: 1px solid transparent;
			
			&:hover { border-color: currentColor; }
		}
	}
	
	.post-activity {
		width: 100%;
		height: auto;
		padding-top: 5px;
		@include clearfix();
		
		$count-size: 25px;
		
		.likes-count,
		.comments-count {
			position: relative;
			width: auto;
			height: $count-size;
			float: left;
			padding-left: $count-size;
			padding-right: 8px;
			margin-right: 5px;
			color: $dark-grey;
			transition: 200ms ease all;
			
			span {
				@include font-size(1.4);
				font-weight: 600;
				line-height: $count-size;
			}
			
			svg {
				position: absolute;
				top: 0;
				left: 0;
				height: $count-size;
				width: $count-size;
				fill: $mid-grey;
				transition: 200ms ease all;
			}
			
			&:hover,
			&.show-likes,
			&.show-comments {
				cursor: pointer;
				background: tint($blue, 20);
				color: $off-black;
				
				svg { fill: $off-black; }
			}
		}
		
		.comments-list {
			width: 100%;
			height: auto;
			float: left;
			@include font-size(1.4);
			max-height: 0;
			overflow: hidden;
			transition: 600ms ease all;
			
			&.show-comments {
				max-height: 400px;
				overflow: auto;
			}
			
			.comments-label {
				width: 100%;
				height: 30px;
				border-top: 1px solid $off-white;
				border-bottom: 1px solid $light-grey;
				@include uppercase();
				line-height: 30px;
				margin-top: 10px;
			}
		}
		
		.comment {
			width: 100%;
			background: $off-white;
			display: table;
			padding: 10px;
			border-bottom: 1px solid $light-grey;

			&:last-child { border-bottom: 0; }
		}

		.commenter-picture {
			display: table-cell;
			vertical-align: top;
			width: 30px;

			img {
				height: 30px;
				width: 30px;
				border-radius: 30px;
			}
		}

		.comment-information {
			display: table-cell;
			vertical-align: top;
			padding-left: 10px;
		}

		.commenter-name {
			float: left;
			@include font-size(1.4);
		}

		.user-name {
			color: $off-black;
			float: left;
			margin-bottom: 0;
			border-bottom: 1px solid transparent;
			text-decoration: none;

			&:hover { border-bottom: 1px solid currentColor; }
		}

		.timestamp,
		.comment-time {
			float: left;
			color: $mid-grey;
			@include font-size(1.2);
			margin-bottom: 5px;
			clear: both;
		}

		.comment-text {
			float: left;
			clear: both;
			@include font-size(1.2);
			color: $dark-grey;
			margin-bottom: 5px;
			
			a {
				color: $blue;
				text-decoration: none;
				word-wrap: break-word;
				border-bottom: 1px solid transparent;

				&:hover {
					border-color: currentColor;
				}
			}
		}
		
		.likes-list {
			width: 100%;
			height: auto;
			float: left;
			@include font-size(1.4);
			max-height: 0;
			overflow: hidden;
			transition: 600ms ease all;
			
			&.show-likes {
				max-height: 400px;
				overflow: auto;
			}
			
			.likes-label {
				width: 100%;
				height: 30px;
				border-top: 1px solid $off-white;
				border-bottom: 1px solid $light-grey;
				@include uppercase();
				line-height: 30px;
				margin-top: 10px;
				margin-bottom: 5px;
			}
			
			a {
				float: left;
				color: $blue;
				text-decoration: none;
				word-wrap: break-word;
				border-bottom: 1px solid transparent;
				margin-right: 4px;
				
				&:after { content: ','; }
				&:last-child:after { display: none; }
				&:hover { border-color: currentColor; }
			}
		}
	}
	
	.nlp-content { margin-top: 10px; }	
}

.search-results-dropdown {
	position: relative;
	float: right;

	&.open {
		.icon-button {
			background: $light-grey;
			max-width: 300px;

			span{
				opacity: 1;
				padding: 0 10px;
			}
		}

		svg {
			transform: rotate(180deg);
		}
	}

	.icon-button {
		position: relative;
		margin: 0;
	}

	.button-text {
		display: inline-block;
		vertical-align: top;
	}

	.chevron {
		display: inline-block;
		vertical-align: top;
		position: relative;
		height: 30px;
		width: 30px;
	}

	svg {
		position: absolute;
		top: 0;
		left: 0;
		height: 20px;
		width: 20px;
		fill: $off-black;
		transform: rotate(0deg);
		transition: all 200ms ease;
	}
}

.post-geo-footer {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 30px;
	border-top: 1px solid $light-grey;
	background: $off-white;
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
}

.search-results-geo-button {
	display: block;
	float: left;
	height: 100%;
	padding-left: 30px;
	padding-right: 10px;

	svg {
		position: absolute;
		top: 0;
		left: 0;
		width: 30px;
		height: 30px;
		fill: $green;
	}

	.description {
		float: left;
		line-height: 30px;
		@include uppercase();
		@include font-size(1.2);
	}

	&:hover {
		background: tint($blue, 20);
	}

	&.relative-geo:hover,
	&.no-geo:hover {
		cursor: default;
		background: $off-white;
	}

	&.relative-geo svg { fill: $blue; }
	&.no-geo svg { fill: $light-grey; }
}
              
            
!

JS

              
                $(document).ready(function() {

		$(document).on("click", ".likes-count", function() {
				var closestLikesList = $(this).parent().find(".likes-list");
				$(this).toggleClass("show-likes");
				closestLikesList.toggleClass("show-likes");
		});

		$(document).on("click", ".comments-count", function() {
				var closestLikesList = $(this).parent().find(".comments-list");
				$(this).toggleClass("show-comments");
				closestLikesList.toggleClass("show-comments");
		});

});
              
            
!
999px

Console