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

              
                <!--Excerpt from https://humanewebmanifesto.com/-->

<main>
	<article class="content">
   <p>The web is becoming hostile to humans. Users are tracked and their privacy is routinely violated. Search results are populated with ads. We are constantly spammed by bots. Generative AI threatens to turn previously useful public forums into soulless marketing soup, while sacrificing the livelihoods of the creators that unwittingly power them <a class="popover-replace" href="#1"><sup>1</sup></a><button popovertarget="ref_1"><sup>1</sup></button><span id="ref_1" popover><cite><a href="https://techwontsave.us/episode/174_why_ai_is_a_threat_to_artists_w_molly_crabapple">Why AI is a Threat to Artists</a></cite>, an interview with artist Molly Crabapple from the podcast Tech Won’t Save Us
	</span>. Power-hungry data centres<a class="popover-replace" href="#2"><sup>2</sup></a><button popovertarget="ref_2"><sup>2</sup></button><span id="ref_2" popover><cite><a href="https://www.theguardian.com/world/2024/feb/15/power-grab-hidden-costs-of-ireland-datacentre-boom">Power grab: the hidden costs of Ireland’s datacentre boom</a></cite>, from The Guardian
	</span> demand the burning of fossil fuels, and divert water and energy from communities, emitting tonnes of carbon in order to power this digital junkyard. Users abandon hostile websites that take too long to load on low-powered devices, or are forced to upgrade, as the pile of electronic waste grows<a class="popover-replace" href="#3"><sup>3</sup></a><button popovertarget="ref_3"><sup>3</sup></button><span id="ref_3" popover><cite><a href="https://gerrymcgovern.com/world-wide-waste/">World Wide Waste</a></cite>, book by Gerry McGovern
	</span>.</p>
		<p>We need a web <strong>by and for humans</strong>.</p>
	</article>
	
	<hr />
	
	<ol class="references">
		<li id="1">
			<cite><a href="https://techwontsave.us/episode/174_why_ai_is_a_threat_to_artists_w_molly_crabapple">Why AI is a Threat to Artists</a></cite>, an interview with artist Molly Crabapple from the podcast Tech Won’t Save Us
		</li>

		<li id="2">
			<cite><a href="https://www.theguardian.com/world/2024/feb/15/power-grab-hidden-costs-of-ireland-datacentre-boom">Power grab: the hidden costs of Ireland’s datacentre boom</a></cite>, from The Guardian
		</li>
		
		<li id="3">
			<cite><a href="https://gerrymcgovern.com/world-wide-waste/">World Wide Waste</a></cite>, book by Gerry McGovern
		</li>
	</ol>
</main>
              
            
!

CSS

              
                /* Styles for browsers that don’t support anchor positioning */
[popovertarget] {
	display: none;
}

@supports (anchor-name: --ref_1) {
	[popovertarget] {
		display: inline;
		color: blue;
		text-decoration: underline;
		padding: 0.1em 0.3em;
		
		&:hover,
		&:focus {
			color: inherit;
		}
	}
	
	[popover] {
		/* Reset */
		margin: 0;
		padding: 0;
		border: 0;

		padding: 1rem;
		background: lavender;
		border-radius: 0.5rem;
		font-size: 1rem;
		max-width: 15rem;
		
		--anchor: --ref_1;
		position-anchor: var(--anchor);
		top: anchor(var(--anchor) 150%);
		left: anchor(var(--anchor) -150%);
		
		position-try-options: --pos-left, --pos-right;
		position-try-order: most-width;
		
		&#ref_2 {
			--anchor: --ref_2;
		}
		
		&#ref_3 {
			--anchor: --ref_3;
		}
	}
	
	@position-try --pos-left {
		left: anchor(var(--anchor) -150%);
	}
	
	@position-try --pos-right {
		right: anchor(var(--anchor) 150%);
		left: auto;
	}
	
	.popover-replace {
		display: none;
	}
	
	.content {
		position: relative;
	}

	[popovertarget="ref_1"] {
		anchor-name: --ref_1;
	}

	[popovertarget="ref_2"] {
		anchor-name: --ref_2;
	}

	[popovertarget="ref_3"] {
		anchor-name: --ref_3;
	}
	
	[popovertarget]:has(+ :popover-open) {
		position: relative;
		background: yellow;
		
		&::before {
			--clip: polygon(50% 0, 100% 100%, 0 100%);
			content: '';
			position: absolute;
			top: 100%;
			left: 50%;
			width: 1rem;
			height: 1rem;
			background: lavender;
			transform: translateX(-50%);
			-webkit-clip-path: var(--clip);
			clip-path: var(--clip);
		}
	}
}

@layer base {
	*, *::before, *::after {
		box-sizing: border-box;
	}
	
	body {
		font-family: 'Syne', sans-serif;
		line-height: 1.6;
		font-size: 1.35rem;
	}
	
	button {
		appearance: none;
		border: none;
		background: none;
		font-size: 1rem;
		cursor: pointer;
	}
	
	main {
		--space-s-l: clamp(1rem, 2vw, 3rem);
		width: 100%;
		max-width: 75ch;
		margin: 0 auto;
		padding: var(--space-s-l);
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console