Pen Settings



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


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


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.


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.


                <div class="psst">
	<div class="container">
		This is an important announcement

<nav class="navbar is-sticky">
	<div class="container mx-auto flex items-center p-6">
		<a class="inline-block h-8 mr-auto" href="#">
			<img class="inline-block h-full w-auto" src="" />

		<ul class="flex items-center">
			<li class="ml-6">
				<a class="text-blue-500 hover:text-blue-800" href="#">Home</a>
			<li class="ml-6">
				<a class="text-blue-500 hover:text-blue-800" href="#">Blog</a>
			<li class="ml-6">
				<a class="text-blue-500 hover:text-blue-800" href="#">Events</a>
			<li class="ml-6">
				<a class="text-blue-500 hover:text-blue-800" href="#">Contact</a>
			<li class="ml-6">
				<a class="text-blue-500 hover:text-blue-800" href="#">About</a>

<main class="main">
	<div class="container my-6 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
		<div class="article">
			<div class="flex-1 bg-white rounded-t rounded-b-none overflow-hidden shadow-lg">
				<a href="#" class="flex flex-wrap no-underline hover:no-underline">
					<img src="" class="h-40 w-full rounded-t pb-4 object-cover">
					<div class="w-full font-bold text-xl text-gray-900 px-4">Lorem ipsum dolor sit amet.</div>
					<p class="text-gray-800 font-serif text-base px-6 mb-5">
						Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam at ipsum eu nunc commodo posuere et sit amet ligula.


	position: fixed;
	/* Must have a fixed height to offset the main content */
	height: 60px;
	top: 0;
	width: 100%;
} {
	position: sticky;
	top: 0;

/* Not important */
.navbar {
	background-color: #fff;
	padding: 22px 0;
	border-bottom: 1px solid #edf2f7;
	display: flex;
	align-items: center;

.container {
	margin-right: auto;
	margin-left: auto;
	padding: 0 16px;

.psst {
	background-color: #2a4365;
	color: #fff;
	text-align: center;
	padding: 16px;

body {
	background-color: #f7fafc;


                // Not important
// Just to generate more articles
const node = document.querySelector('.article');
[...Array(10)].forEach(_ => node.parentNode.insertBefore(node.cloneNode(true), node));