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


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.


                2020/3/5 update:
Chrome 的相关 bug 已在以下地址讨论并修复,感谢撰写详细 issues 的朋友
----以下信息可能已过时,请参考上面的 update ----

点击 A 块时,A 获得了蓝色背景,同时,因为 A 的内联样式,使得 B 块满足 p[style] + p,B 块应同时获得绿色背景。然而,在 Chrome 中测试,B 块并无变化。这时,点击 B 块,B 块获得黄色边框,绿色背景和黄色边框同时出现。由此,可知 Chrome 存在一重绘 bug,对比测试显示,Firefox 并无此 bug
<p id="A">A</p>
<p id="B">B</p>



                p {
	margin:10px auto;
	border:5px solid red;

p[style] + p {



                self.A.onclick = () => = 'background:blue';
self.B.onclick = () => = 'border:5px solid yellow';