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-0">
		<img src="https://images.unsplash.com/photo-1537241969145-07fd0fa8083b?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" alt="">
	</div>
	<div class="panel-1"></div>
<!-- 	<div class="panel-2"></div> -->
 	<div class="panel-3"></div>
	<div class="panel-4"></div>
	<div class="panel-5"></div>
	<div class="panel-6"></div>
</main>

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

CSS

              
                .comic {
	display: grid;
	grid-template-columns: 1.65fr 1.4fr repeat(3, 1fr) 0.35fr repeat(2, 0.6fr);
	grid-template-rows: 4fr 1.25fr 0.5fr 1fr 1.45fr repeat(2, 0.5fr) 0.45fr 0.8fr 0.45fr;
	overflow: hidden;
	background-size: cover;
}

.panel-0 {
	grid-row: 1 / -1;
	grid-column: 1 / -1;
	
	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		filter: grayscale(0.8);
	}
}

.panel-1 {
	grid-row: 1 / span 3;
	grid-column: 1 / span 4;
	transform: perspective(200px) rotateX(-14deg) rotateY(6deg) rotateZ(-10deg);
	background-color: rgba(0, 156, 255, 0.6);
	border: 6px solid white;
	z-index: 4;
}

.panel-2 {
	background-color: purple;
	grid-row: 1 / span 4;
	grid-column: 3 / span 6;
	opacity: 0.3;
	z-index: 4;
}

.panel-3 {
	grid-row: 2 / span 3;
	grid-column: 2 / span 4;
	transform: perspective(600px) rotateX(-16deg) rotateY(4deg);
	clip-path: polygon(207px -7px, 315px -8px, 310px 189px, -1.83% 102.7%, -6px 88px, 69.97% 20.69%);
	background-color: rgba(0, 156, 255, 0.6);
	border: 6px solid white;
	z-index: 3;
}

.panel-4 {
	grid-row: 3 / span 4;
	grid-column: 3 / span 6;
	transform: perspective(200px) rotateX(-12deg) rotateY(-2deg) rotateZ(4deg);
	clip-path: polygon(179px -4px, 354px -3px, 334px 256px, -7px 250px, -1.52% 43.21%, 60.36% 37.67%);
	border: 6px solid white;
	background-color: rgba(0, 156, 255, 0.6);
	z-index: 2;
}

.panel-5 {
	grid-row: 6 / span 3;
	grid-column: 4 / span 3;
	transform: perspective(200px) rotateY(-4deg) rotateZ(-8deg);
	clip-path: polygon(-5px -3px, 213px 41px, 174px 102px, -1px 125px);
	background-color: rgba(0, 156, 255, 0.6);
	border: 6px solid white;
	z-index: 1;
}

.panel-6 {
	grid-row: 8 / span 2;
	grid-column: 5 / span 3;
	transform: rotateZ(6deg);
	clip-path: polygon(-3px 34px, 68.69% 20.63%, 69.21% -3.32%, 168px -2px, 136px 102px, 0px 100px);
	background-color: rgba(0, 156, 255, 0.6);
	border: 6px solid white;
}

// 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;
	margin: 2rem 0;
	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