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

              
                <section class="theme-block">
	<header class="header">
		<div class="header-inner">
			<a href="#" class="header-logo">
				<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" aria-hidden="true">
					<path d="M12 11.3884C11.0942 9.62673 8.62833 6.34423 6.335 4.7259C4.13833 3.17506 3.30083 3.4434 2.75167 3.69256C2.11583 3.9784 2 4.95506 2 5.52839C2 6.10339 2.315 10.2367 2.52 10.9276C3.19917 13.2076 5.61417 13.9776 7.83917 13.7309C4.57917 14.2142 1.68333 15.4017 5.48083 19.6292C9.65833 23.9542 11.2058 18.7017 12 16.0392C12.7942 18.7017 13.7083 23.7651 18.4442 19.6292C22 16.0392 19.4208 14.2142 16.1608 13.7309C18.3858 13.9784 20.8008 13.2076 21.48 10.9276C21.685 10.2376 22 6.10256 22 5.52923C22 4.95423 21.8842 3.97839 21.2483 3.6909C20.6992 3.44256 19.8617 3.17423 17.665 4.72423C15.3717 6.34506 12.9058 9.62756 12 11.3884Z"></path>
				</svg>
				<span>Bluesky's homepage</span>
			</a>
			<nav class="header-navigation">
				<a href="#" class="header-link">Company</a>
				<a href="#" class="header-link">Blog</a>
				<a href="#" class="header-link">App</a>
			</nav>
			<button class="header-menu-toggle">
				<span>More</span>
				<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" aria-hidden="true">
					<path d="M12 15.6315L20.9679 10.8838L20.0321 9.11619L12 13.3685L3.9679 9.11619L3.03212 10.8838L12 15.6315Z"></path>
				</svg>
			</button>
		</div>
	</header>
</section>
<section class="theme-block">
	<header class="header">
		<div class="header-inner">
			<a href="#" class="header-logo">
				<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" aria-hidden="true">
					<path d="M12 11.3884C11.0942 9.62673 8.62833 6.34423 6.335 4.7259C4.13833 3.17506 3.30083 3.4434 2.75167 3.69256C2.11583 3.9784 2 4.95506 2 5.52839C2 6.10339 2.315 10.2367 2.52 10.9276C3.19917 13.2076 5.61417 13.9776 7.83917 13.7309C4.57917 14.2142 1.68333 15.4017 5.48083 19.6292C9.65833 23.9542 11.2058 18.7017 12 16.0392C12.7942 18.7017 13.7083 23.7651 18.4442 19.6292C22 16.0392 19.4208 14.2142 16.1608 13.7309C18.3858 13.9784 20.8008 13.2076 21.48 10.9276C21.685 10.2376 22 6.10256 22 5.52923C22 4.95423 21.8842 3.97839 21.2483 3.6909C20.6992 3.44256 19.8617 3.17423 17.665 4.72423C15.3717 6.34506 12.9058 9.62756 12 11.3884Z"></path>
					<span>Bluesky's homepage</span>
				</svg>
			</a>
			<nav class="header-navigation">
				<a href="#" class="header-link">Company</a>
				<a href="#" class="header-link">Blog</a>
				<a href="#" class="header-link">App</a>
			</nav>
			<button class="header-menu-toggle">
				<span>More</span>
				<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" aria-hidden="true">
					<path d="M12 15.6315L20.9679 10.8838L20.0321 9.11619L12 13.3685L3.9679 9.11619L3.03212 10.8838L12 15.6315Z"></path>
				</svg>
			</button>
		</div>
	</header>
</section>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap");

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

body {
	line-height: 1.5;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

input,
textarea,
select {
	font: inherit;
}

button {
	padding: 0;
	border: 0;
	border-radius: 0;
	font: inherit;
	color: inherit;
	border: 1px solid currentColor;
	background-color: transparent;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

a {
	color: inherit;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

html {
	color-scheme: light dark;
}

body {
	font-family: "Geist", sans-serif;
	display: grid;
	min-height: 100dvh;
}

.theme-block {
	background-color: light-dark(#f2f5f7, #111);
	color: light-dark(#000, #fff);
	display: grid;
	place-items: center;
}

.theme-block:first-of-type {
	color-scheme: light;
}

.theme-block:last-of-type {
	color-scheme: dark;
}

.header {
	container: headerContainer / inline-size;
	padding-block: clamp(0.5rem, 3vw, 0.75rem);
	padding-inline-start: clamp(1.25rem, 5vw, 1.5rem);
	padding-inline-end: clamp(0.5rem, 3vw, 0.75rem);
	margin-inline: auto;
	width: min(60rem, 95%);
	background-color: light-dark(#fff, #222);
	border: 1px solid light-dark(#ddd, #444);
	border-radius: 0.75rem;
	column-gap: 5cqi;
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 5cqi;
}

.header-logo {
	flex-shrink: 0;
	color: light-dark(#0085ff, #0085ff);
	font-size: 2em;
	margin-inline-end: auto; // To align nav in the middle
	text-decoration: none;
}

.header-logo span {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.header-logo:hover {
	color: light-dark(
		color-mix(in srgb, #000 20%, #0085ff),
		color-mix(in srgb, #fff 20%, #0085ff)
	);
}

.header-menu-toggle {
	margin-inline-start: auto; // To align nav in the middle
	border: 0;
	border-radius: 0.375rem;
	padding-block: 0.5em;
	padding-inline-start: 1.25em;
	padding-inline-end: 1em;
	display: flex;
	align-items: center;
	column-gap: 0.5em;
	border: 1px solid light-dark(#ddd, #444);
}

.header-menu-toggle:hover {
	background-color: light-dark(#f2f2f2, #2c2c2c);
}

.header-menu-toggle * {
	flex-shrink: 0;
}

.header-menu-toggle svg {
	font-size: 1.5em;
}

@container headerContainer (max-width: 30rem) {
	.header-menu-toggle {
		aspect-ratio: 1;
		padding-inline: 0.5em;
	}

	.header-menu-toggle span {
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		height: 1px;
		overflow: hidden;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}
}

.header-navigation {
	display: flex;
	flex-wrap: wrap;
	column-gap: 0.5cqi;
}

.header-link {
	text-decoration: none;
	display: inline-block;
	border-radius: 0.375rem;
	background-color: transparent;
	padding: 0.5em 0.75em;
}

.header-link:hover {
	background-color: light-dark(#eee, #333);
}

              
            
!

JS

              
                
              
            
!
999px

Console