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

              
                <main>
  <h2>Include URLs in a Print Stylesheet</h2>
   <p>Try printing this page (or just do a print preview). Notice the URLs for the links will appear in the printed page, but not on the live page itself.</p>
  <p class="purls">Visit <a href="https://www.codeinwp.com/" target="_blank">CodeinWP</a> for content to help you build better websites. You can try out the <a href="https://www.codeinwp.com/blog/wordpress-cheat-sheets-web-development-design/" target="_blank">cheat sheets</a> or even the <a href="https://www.codeinwp.com/blog/category/wordpress-comics/" target="_blank">tech comics</a>.</p>
  
  <p>Use the button below to toggle the URLs to see what it will look like when they are printed.</p>
  
  <button>Toggle URLs</button>

</main>
              
            
!

CSS

              
                body {
  font-family: Arial, sans-serif;
  font-size: 20px;
  padding: 0 20px;
}

main {
  text-align: center;
  margin: 0 auto;
  max-width: 800px;
}

p {
  text-align: left;
  padding: 0 20px;
}

code {
  color: firebrick;
}

a {
  color: firebrick;
}

a:hover {
  color: navy;
}

.viewurls a::after {
  content: " (" attr(href) ")";
}

@media print {
  a::after {
    content: " (" attr(href) ")";
  }
}
              
            
!

JS

              
                let purls = document.querySelector('.purls'),
    btn = document.querySelector('button');

btn.addEventListener('click', function () {
  purls.classList.toggle('viewurls');
}, false);
              
            
!
999px

Console