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

              
                <div class="container">
	<div class="item">
		<div class="image">
			<img
				src="https://images.unsplash.com/photo-1570970580763-7993ca30d726?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ"
				alt="">
			<button class="name">Plane One</button>
		</div>
		<div class="desc">Vestibulum elit erat, fringilla eget libero eget, aliquet interdum ex. Morbi venenatis massa ut
			justo imperdiet sagittis. In et dictum leo. Nam ornare felis sit amet nisl gravida, scelerisque consectetur turpis
			tempor. Donec feugiat sapien nisi, vitae tempus leo tincidunt ac. Pellentesque condimentum elit ullamcorper,
			facilisis lacus eu, suscipit ante. Nulla massa arcu, maximus at quam quis, luctus faucibus ex.
			<button>Close</button>

		</div>
	</div>
	<div class="item">
		<div class="image">
			<img
				src="https://images.unsplash.com/photo-1487692703274-4965f352a3ef?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ"
				alt="">
			<button class="name">Plane Two</button>

		</div>
		<div class="desc">Duis luctus pretium pretium. Sed scelerisque ipsum egestas lorem semper tempor. Nam consectetur
			massa enim, sit amet facilisis metus commodo sollicitudin. Ut at pretium enim, quis lobortis purus. Mauris vehicula
			turpis nec libero fermentum ultricies. Integer interdum pulvinar porttitor. Phasellus finibus turpis vitae augue
			aliquet, ac dapibus odio eleifend. Pellentesque auctor purus at varius consequat. Vestibulum vel justo a tellus
			ultricies posuere ut at lacus.
			<button>Close</button>
		</div>
	</div>
</div>
              
            
!

CSS

              
                .container {
	width: 800px;
	display: flex;
	justify-content: space-around;
}

button {
	cursor: pointer;
	border: none;
	color: #fff;
	cursor: pointer;
}

.item {
	width: calc(100% - 20px / 2);
	margin-right: 20px;
}

img {
	max-width: 100%;
}

.image {
	position: relative;
	border-bottom: 10px solid #AFB42B;
}

.name {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	background: rgba(0,0,0,0.75);
	padding: 20px;
	
	&:hover,
	&:focus {
		background: rgba(0,0,0,0.9);
	}
}

.desc {
	display: none;
	background: #AFB42B;
	padding: 20px;
	
	&.active {
		display: block;
	}
	
	button {
		display: block;
		background-color: #222;
		padding: 10px 15px;
		margin-top: 15px;
	}
}
              
            
!

JS

              
                $('.name').on('click', function() {
	var parentItem = $(this).closest('.item');
	$(parentItem).find('.desc').toggle();
});

$('.desc button').on('click', function() {
		$(this).parent('.desc').hide();
});

              
            
!
999px

Console