Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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="wrap"> <img src="https://picsum.photos/id/237/1200/800">
		<div class="caption">
				<div class="caption-inner">
						<div class="caption-content">
								<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc nisl leo, aliquet sed magna sit amet, hendrerit sollicitudin velit. Nullam condimentum sagittis sagittis. Aenean sit amet lacinia orci. Curabitur elementum felis felis, ut convallis nunc bibendum vitae. Cras accumsan lectus erat, in ultricies nunc consequat non. Integer eget sagittis mauris. Praesent accumsan nec nulla vitae bibendum. Vivamus dapibus a sem lacinia viverra. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent rutrum enim egestas rutrum hendrerit.</p>
						</div>
				</div>
		</div>
</div>
              
            
!

CSS

              
                .wrap {
	max-width:960px;
	min-width:280px;
	margin:auto;
	position:relative;
}
.wrap img {
	width:100%;
	height:auto;
	border:1px solid #000;
}
.caption {
	position:absolute;
	top:5px;
	left:0;
	right:0;
	bottom:10px;
	overflow:auto;
}
.caption-inner {
	display:table;
	width:100%;
	height:100%;
}
.caption-content {
	display:table-cell;
	vertical-align:middle;
}
.caption-content p {
	margin:0 50px;
	background:rgba(255,255,255,0.4);
	padding:10px;
}

              
            
!

JS

              
                
              
            
!
999px

Console