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

              
                <main class="grid">
	<h1>My Awesome Website</h1>
	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Nunc faucibus a pellentesque sit amet porttitor. Placerat vestibulum lectus mauris ultrices. Eu consequat ac felis donec et. Nisi est sit amet facilisis magna etiam tempor. Eget gravida cum sociis natoque penatibus et magnis. Tellus integer feugiat scelerisque varius. Vestibulum lorem sed risus ultricies tristique nulla aliquet enim tortor.</p>
	<img src='https://images.unsplash.com/photo-1490750967868-88aa4486c946?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE2NTY3MDgyMTU&ixlib=rb-1.2.1&q=80&w=400' alt='Bright yellow flowers against a blue sky'>
	<article class="full-width">
		<h2>Full width section</h2>
	</article>
	<p>Nisi est sit amet facilisis. Vitae tortor condimentum lacinia quis. Imperdiet nulla malesuada pellentesque elit. Scelerisque mauris pellentesque pulvinar pellentesque habitant morbi. Ut tristique et egestas quis ipsum suspendisse ultrices gravida dictum. Eu feugiat pretium nibh ipsum consequat nisl vel pretium lectus.</p>
	<h2>Some heading</h2>
	<p>Vel risus commodo viverra maecenas accumsan lacus vel facilisis. Condimentum lacinia quis vel eros donec ac odio tempor orci. Adipiscing elit ut aliquam purus sit amet luctus. Bibendum arcu vitae elementum curabitur vitae nunc sed velit. Tincidunt praesent semper feugiat nibh sed pulvinar proin.</p>
</main>
              
            
!

CSS

              
                * {
	box-sizing: border-box;
}

body {
	--pad: clamp(1rem, 3vw, 3rem);
	font-family: "Open Sans", sans-serif;
	line-height: 1.6;
	margin: 0;
}

h1, h2, p {
	margin-block: 0;
}

p {
	max-width: 90ch;
}

img {
	width: 100%;
	display: block;
}

.grid {
	display: grid;
	grid-template-columns: [full-start] 1fr [wrapper-start] minmax(0, 70rem) [wrapper-end] 1fr [full-end];
	gap: 0 var(--pad, 1rem);
}

.grid > * {
	grid-column: wrapper;
	margin-block-start: var(--pad);
}

.grid > :is(h1, h2) + p {
	margin-block-start: calc(var(--pad) * 0.5);
}

.full-width {
	grid-column: full;
	background: pink;
	padding: var(--pad);
	aspect-ratio: 5 / 1;
	display: grid;
	place-items: center;
}
              
            
!

JS

              
                
              
            
!
999px

Console