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

              
                <h1>I really want <div>my heading to be on two lines</div></h1>
<p><div>hi there</p> <!-- invalid to nest a div in a paragraph, and missing a closing </div> -->

<!-- invalid nesting of a link within a button -->
<button aria-pressed=false><a href=https://example.com target=_blank>let's do something</a> (but what?)</button>


<div class=notes>
	Navigating with virtual cursor (JAWS/NVDA - down arrow), there will be 'two' h1s - "to test" and "things".  Navigating by the <b>H</b> key alone, there is a single heading.
	
	<p>Navigating to the button with the virtual cursor, Narrator, NVDA and JAWS will not announce the existence of the invalid nested link.  Navigating to the link with the Tab key there can be <strong>no announcement</strong> of the focused link text or role.  Attempting to activate while the screen reader is on will result in <strong>no action</strong> taking place.  In contrast to this, without a screen reader enabled a user can keyboard tab to the invalid nested link and the link will properly function.</p>
</div>
              
            
!

CSS

              
                body {padding: 1.5em}
button[aria-pressed=true] {
	background: #000;
	color: #fff;
	
	a {
		color: #fff;
	}
}

*:focus {
	outline: 2px solid #f00;
	outline-offset: 1px;
}

.notes {
	margin: 1em 0;
	max-width: 600px;
}
              
            
!

JS

              
                document.querySelector('button').addEventListener('click', function () {
	if ( this.getAttribute('aria-pressed') === 'false') {
		this.setAttribute('aria-pressed', 'true')
	}
	else {
		this.setAttribute('aria-pressed', 'false')
	}
})
              
            
!
999px

Console