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

              
                <!-- added aria-hidden to the SVG -->

<svg aria-hidden="true">
	<use xlink:href="#icon-location"></use>
</svg>
<span>locations</span>

<!-- Adding aria-hidden to the svg worked in all combos
 -->
<a href="#cart">
	<svg aria-hidden="true">
		<use xlink:href="#icon-cart"></use>
	</svg>
	<span>cart (1)</span>
</a>

<!-- adding aria-hidden="true" to the svg works -->
<button type="button">
	<svg aria-hidden="true">
		<use xlink:href="#icon-cart"></use>
	</svg>
	<span>Add to cart</span>
</button>

<!-- SVG SPRITE -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" style="display: none;">
	<symbol id="icon-location" viewBox="0 -100 500 512">
		<path d="M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z" transform="rotate(-20)" />
	</symbol>
	<symbol id="icon-cart" viewBox="0 0 26.458 26.458">
		<path d="M2.406 2.91c-.972-.029-1.135 1.379-.182 1.572l1.755.385c.929 4.442 1.941 8.865 2.923 13.296.08.363.402.622.775.622h13.938c1.074.016 1.074-1.603 0-1.588H8.314l-.352-1.587H22.32a.794.794 0 0 0 .775-.621l1.758-7.937a.794.794 0 0 0-.775-.965c-6.073 0-12.146 0-18.219-.003l-.431-2.047a.794.794 0 0 0-.607-.612L2.563 2.93a.785.785 0 0 0-.157-.02zm8.575 16.405c-1.16 0-2.117.957-2.117 2.116 0 1.16.957 2.117 2.117 2.117 1.16 0 2.116-.957 2.116-2.117 0-1.16-.957-2.116-2.116-2.116zm7.407 0c-1.16 0-2.116.957-2.116 2.116 0 1.16.957 2.117 2.116 2.117 1.16 0 2.117-.957 2.117-2.117 0-1.16-.957-2.116-2.117-2.116z" />
	</symbol>
</svg>
              
            
!

CSS

              
                ///
// helper css just in for codepen
//

body {
	color: #000;
	font-family: "Roboto Mono", monospace;
}

svg {
	height: 24px;
	width: 24px;
}

a {
	display: block;
	margin: 1em;
}

button {
	border: 3px solid;
	background: none;
	padding: 1em;
	display: block;
	svg {
		height: 24px;
		width: 24px;
		display: block;
		margin: 0 auto 0.5em;
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console