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

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

              
                <!-- this "sprite-like" SVG needs to be up at the top of your page -->
<!-- it's hidden - and used to pull pieces from -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
  
	<filter id='shadow' color-interpolation-filters="sRGB">
		<feDropShadow dx="2" dy="2" stdDeviation="3" flood-opacity="0.5"/>
	</filter>

	<symbol id="icon-bookmark" viewBox="0 0 512 512">
		<path d="m406 37c4 0 8 0 12 2 7 3 12 7 15 12 4 5 6 11 6 18l0 368c0 6-2 12-6 18-3 5-8 9-15 11-3 2-8 3-12 3-9 0-17-3-24-10l-126-121-126 121c-7 7-15 10-24 10-4 0-8-1-12-3-7-2-12-6-15-11-4-6-6-12-6-18l0-368c0-7 2-13 6-18 3-5 8-9 15-12 4-2 8-2 12-2z"/>
	</symbol>

	<symbol id="icon-file" viewBox="0 0 512 512">
		<path d="m329 146l0-135c4 3 8 6 10 8l117 117c3 3 5 6 8 10z m-36 9c0 8 2 15 8 20 5 5 11 8 19 8l155 0 0 302c0 7-2 14-8 19-5 5-11 8-19 8l-384 0c-8 0-14-3-19-8-6-5-8-12-8-19l0-458c0-7 2-14 8-19 5-5 11-8 19-8l229 0z"/>
	</symbol>

	<symbol id="icon-star" viewBox="0 0 512 512">
		<path d="m494 185c0 4-3 9-8 14l-103 101 24 143c0 1 0 3 0 5 0 4-1 8-3 10-2 3-4 5-8 5-4 0-8-2-12-4l-128-67-128 67c-4 2-8 4-12 4-4 0-7-2-9-5-2-2-3-6-3-10 0-1 0-3 1-5l24-143-104-101c-4-6-7-10-7-14 0-7 6-12 16-13l144-21 64-130c4-8 8-12 14-12 6 0 10 4 14 12l64 130 144 21c10 1 16 6 16 13z"/>
	</symbol>
  
</svg>


<nav class='space-example'>
	
	<a class='icon icon-star' href='#'>
	  <svg><use href="#icon-star"></use></svg>
	</a>

	<a class='icon icon-bookmark' href='#'>
	  <svg><use href="#icon-bookmark"></use></svg>
	</a>

	<a class='icon icon-file' href='#'>
	  <svg><use href="#icon-file"></use></svg>
	</a>
	
</nav>



<nav class='shadow-example'>
	
	<a class='icon icon-star' href='#'>
	  <svg><use href="#icon-star"></use></svg>
	</a>

	<a class='icon icon-bookmark' href='#'>
	  <svg><use href="#icon-bookmark"></use></svg>
	</a>

	<a class='icon icon-file' href='#'>
	  <svg><use href="#icon-file"></use></svg>
	</a>

</nav>
              
            
!

CSS

              
                
a.icon {
	display: inline-block;
	text-decoration: none;
	color: initial;
	color: navy;
	width: min-content;
	padding: 10px; /* more touchable/hoverable area */
	--size: 18px;
}

a.icon svg {
	display: block;
	width: var(--size);
	height: var(--size);
	fill: currentColor;
}

a.icon:hover {
	color: salmon;
}





/*

*/



.shadow-example {
	display: flex;
	flex-direction: row;
}

.shadow-example svg {
	filter: drop-shadow(.05em .05em .05em rgb(0 0 0 / 0.4));
}

/* just for explanation */
body {
	padding: 20px;
}

.space-example a.icon {
	border: 1px solid rgba(0,0,0,.1);
}

.space-example a.icon svg {
	border: 1px solid rgba(0,0,0,.1);
}
              
            
!

JS

              
                
// more fun things to play with

// https://css-tricks.com/adding-shadows-to-svg-icons-with-css-and-svg-filters

// https://css-tricks.com/svg-use-with-external-reference-take-2
              
            
!
999px

Console