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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.


                <h1 class="icon-bg">Colouring an SVG icon used in a background</h1>
<p>SVG icons via data uri. No sprite sheet, no external resource, no repeated code.</p>
<p>The marker icon has no colour attribute, that comes from CSS.</p>
<h2 class="icon-bg">Different elements - different colours</h2>
<p><a href="#" class="icon-bg">Hover me</a></p>
<p><small>This is a combination of other techniques. Most notable: and<br>
I just brought these two together into a :before pseudo element where they could be targeted.</small></p>


                .icon-bg:before {
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="" xmlns:xlink="" version="1.1"  width="24" height="24" viewBox="0 0 24 24"><path d="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z" /></svg>');
	background-repeat: no-repeat;
h1.icon-bg:before {filter: invert(.4) sepia(1) saturate(3) hue-rotate(160deg);
h2.icon-bg:before {filter: invert(.6);
a.icon-bg:hover:before {filter: invert(.4) sepia(1) saturate(3) hue-rotate(270deg);

body {
  margin:10% 20% 0;