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

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

              
                <article class="layout">
	<header class="layout-title">
		<h1>Cupcake ipsum dolor</h1>
	</header>
	<section class="layout-blurb">
		<p>Caramels gingerbread I love liquorice. Jujubes cotton candy sesame snaps. Jelly lemon drops macaroon tootsie roll liquorice I love. Caramels I love apple pie. Ice cream pastry chocolate cake chupa chups I love. Chocolate bar fruitcake sweet I love.</p>
	</section>
	<section class="layout-image portrait">
		<figure>
			<img src="https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" alt="" />
		</figure>
	</section>
	<section class="layout-circle portrait">
		<figure>
			<img src="https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ" alt="" />
		</figure>
	</section>
</article>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Crimson+Text&display=swap');

body {
	--white: #fdfff4;
	--black: #1F1507;
	--primCol: #EFEC8A;
	--secCol: beige;
	--size: 1rem;
	
	font-family: 'Crimson Text', serif;
	line-height: 1.3;
	color: var(--black);
}

/* image */
.portrait figure {
	width: 100%; height: 100%;
	background-color: var(--secCol);
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover, 110% 110%;
	background-image:
		url('https://images.unsplash.com/photo-1517196084897-498e0abd7c2d?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ'),
		url('https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&ixid=eyJhcHBfaWQiOjE0NTg5fQ');
	background-blend-mode: hard-light;
}
.portrait figure img {
	mask-image: linear-gradient(90deg, black, transparent 90%);
	object-fit: cover;
	width: 100%; height: 100%;
	display: block;
	filter: contrast(110%) saturate(120%);
}

/* layout + elements */
.layout {
	width: 100vw; height: 100vh;
	display: grid;
	grid-template-columns: repeat(11, 8.4vw) 1fr;
	grid-template-rows: repeat(7, 12.3vh) 1fr;
	
	background-color: var(--white);
	background-repeat:no-repeat;
	background-image:
		url('https://images.unsplash.com/photo-1517196084897-498e0abd7c2d?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ'),
		linear-gradient(90deg, var(--white) 30%, var(--primCol) 30%, var(--primCol) 90%, var(--white) 90%)
		;
	background-position: bottom right, top left;
	background-size: 40vw 60vh, 100vw 93vh;
	background-blend-mode: hard-light, normal;
}
.layout-title {
	grid-area: 2 / 6 / 8 / 7;
	padding: var(--size);
	border: 6px solid var(--black);
	border-width: 6px 0px;
}
.layout-title h1 {
	width: 70vh;
	// margin-bottom: -50px;
	font-size: calc(var(--size) * 2);
	text-transform: uppercase;
	transform: rotate(270deg) translateX(-68vh);
	transform-origin: left top;
}
.layout-blurb {
	grid-area: 2 / 2 / 8 / 6;
	padding: var(--size);
	border: 6px solid var(--black);
	text-align: right;
	font-size: 1.2rem;
	
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
}
.layout-blurb p {
	width: 70%;
}
.layout-image {
	grid-area: 2 / 7 / 8 / 12;
	border: 6px solid var(--black);
	position: relative;
}
.layout-image figure img {
	mask-image:
	radial-gradient(50% 60% at 50% 60%, transparent 40%, black 70%),
	linear-gradient(90deg, black 36%, transparent 90%);
}
.layout-image::after {
	content: '';
	width: 100vw; height: 6px;
	background-color: var(--black);
	position: absolute; top: 0px; right: 0px;
	transform: rotate(340deg);
	transform-origin: top right;
}
.layout-circle {
	grid-area: 1 / 1 / 4 / 5;
	padding: var(--size);
	box-sizing: border-box;
}
.layout-circle figure {
	width: 24vmin; height: 24vmin;
	border: 6px solid var(--black);
	border-radius: 50%;
	background-size: cover, 28vmin;
}
.layout-circle figure img {
	border-radius: 50%;
}


              
            
!

JS

              
                
              
            
!
999px

Console