Pen Settings



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


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.


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.


                <h1 class="site-title">My cool site</h1>
<!-- <h1>You won't see me on the page – I've been commented!</h1> -->
  <button class="play-button">Click me?</button>    
<p>If you're wondering why the HTML of this page looks a little different than on the tutorial, it's because CodePen automatically includes the CSS and JS.</p>
<p>Hey! Welcome to my portfolio page. Here's my <a href="/works">work</a>, my <a href="/bio">bio</a>, and my <a href="/blog">blog</a>. Below is an image of me.</p>
<p><img src="" /></p>
  <audio controls>
    <source src="" type="audio/mpeg">


                body {
  background: lightblue;
  color: blue;

.site-title {
  font-family: "Helvetica", "Arial", sans-serif;
  font-style: italic;
  font-size: 2rem;
  margin-bottom: 2rem;

a:link, a:visited {
  color: red;
  text-decoration: underline dotted green;
audio {
  display: none;

.play-button {
  background: blue;
  border: 1px dashed white;
  color: white;
  font-family: monospace;
  padding: 1em;
  text-transform: uppercase;


                let state = false;
const playButton = document.querySelector(".play-button");
const audioElement = document.querySelector("audio");

playButton.addEventListener("click", () => {
  if (state == false) {;
    playButton.innerText = "Pause";
    state = true;
  else {
    playButton.innerText = "Play";
    state = false;