Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <main>
	<ul id="gallery">
		<li>
			<img src="http://talks.local/grid-to-the-future/marty-doc-1985.jpg" alt=""/>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/einstein.jpg" alt=""/>
			<p>Einstein (nach dem das Einsteinufer benannt ist)</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/flux-ui.jpg" alt=""/>
			<p>User interce design anno 1985</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/marty-doc-1955.jpg" alt=""/>
			<p>„Sag nichts!“</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/marty-loraine.jpg" alt=""/>
			<p>Calvin Klein.</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/marty-biff-george-bar.jpg" alt=""/>
			<p>“Anybody home, McFly?”</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/darth-vader.jpg" alt=""/>
			<p lang="de">Darth Vader vom Planeten Vulkan. 🖖 🤣</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/biff-manure.jpg" alt=""/>
			<p lang="de">„Ich hasse Mist!“</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/goldie-wilson.jpg" alt=""/>
			<p>„Bürgermeister‽ Dann mache ich die Stadt sauber.“</p>
			<p>„Du kannst gleich mit dem Fußboden hier anfangen.“</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/marty-band.jpg" alt=""/>
			<p>“Go, Johnny, go, go!”</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/doc-clock.jpg" alt=""/>
			<p>It’s doc o’clock.</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/strickland.jpg" alt=""/>
			<p>“You’re a slacker, McFly. And your old man was a slacker, too.“</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/hoverboard-pond.jpg" alt=""/>
			<p>Wasserlandung.</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/marty-doc-clock.jpg" alt=""/>
			<p>Damals, als es noch keine Selfies gab.</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/klara-doc.jpg" alt=""/>
			<p>„Dann sehe ich klara.“</p>
			<button aria-label="Back to the future"></button>
		</li>
		<li>
			<img src="http://talks.local/grid-to-the-future/klara-locomotive.jpg" alt=""/>
			<p>Point of no return.</p>
			<button aria-label="Back to the future"></button>
		</li>
	</ul>
<main>

              
            
!

CSS

              
                body
{
	margin: 0;
	padding: 2em;
}

#gallery
{
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12em, 1fr));
	grid-gap: 2em 2em;
}

#gallery > li
{
	display: flex;
	flex-flow: column nowrap;
}

#gallery > li > *
{
	margin: 0 0 0.6em;
}

#gallery p
{
	font-family: Futura, sans-serif;
	line-height: 1.2;
}

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

#gallery button
{
	align-self: flex-end;
	margin-top: auto;
	margin-bottom: 0;
	font: 0.75em/1 'Back to the future 2002', Impact, sans-serif;
	border: none;
	border-radius: 0.5em;
	padding: 0.75em 1.25em 0.5em;
	background: navy;
	color: gold;
}

#gallery button::before
{
	content: 'BACK<';
	display: block;
	font-size: 1.35em;
	text-indent: -.25em;
	text-transform: uppercase;
}

#gallery button::after
{
	content: '&future';
	display: block;
	text-indent: .25em;
	text-transform: lowercase;
}

              
            
!

JS

              
                const replacementImageSrc = 'https://bittersmann.de/talks/grid-to-the-future/title.jpg';
const imgElements = document.querySelectorAll('#gallery img');

window.setTimeout(function () {
	imgElements.forEach(imgElement => {
		console.log(imgElement.offsetHeight);
		if (imgElement.offsetHeight < 100)
			imgElement.src = replacementImageSrc;
	});
}, 500);
              
            
!
999px

Console