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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <main class="comic">
	<div class="panel-1">
			<img src='https://images.unsplash.com/photo-1523597020744-b68b1edd3e1c?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ' alt=''>
		<p>But if he'd known what wheels had started spinning over on Wreath, my father never would have left those tunnels.</p>
	</div>
	<div class="panel-2">
		<img src='https://images.unsplash.com/photo-1485470733090-0aae1788d5af?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ' alt=''>
	</div>
	<div class="panel-3">
		<img src='https://images.unsplash.com/photo-1542838776-096d877b5aa2?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ' alt=''>
	</div>
</main>

<a class="collection" href="https://codepen.io/collection/DjwRaP/" target="_blank">comic layout collection</a>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Raleway:100");

.comic {
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: 1.4fr 2fr 1fr;
	grid-gap: 0.25rem;
	margin: 0 auto;
}

[class^=panel-] {
	background-color: #080808;
	overflow: hidden;
	
	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

.panel-1 {
	position: relative;
	color: rgba(255, 255, 255, 0.8);
	font-size: 1.1rem;
	font-weight: 100;
	font-family: Raleway;
	
	p {
		margin: 0;
		margin-left: 100px;
		margin-top: 8px;
		width: 400px;
		line-height: 1.4;
		font-style: italics;
	}
	
	img {
		float: right;
		width: 800px;
		height: 800px;
		margin-right: -360px;
		margin-top: -116px;
		border-radius: 50%;
		shape-outside: circle(219px at 355px 225px);
	}
}

// Themeing

body {
	background-color: #333745;
	display: grid;
	place-items: start center;
	grid-template-rows: max-content auto;
	gap: 1rem;
	height: 100vh;
}

.comic {
	width: 500px;
	height: 705px;
	padding: 1rem;
	margin: 2rem 0;
	background-color: #fff;
	box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.2);
}

.collection {
	position: absolute;
	display: block;
	padding: 0.5rem 1rem;
	border: 1px solid #F07739;
	left: 10px;
	top: 10px;
	color: #F07739;
	text-decoration: none;
	font-weight: 700;
	
	&:hover {
		background-color: #F07739;
		color: #333745;
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console