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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <!DOCTYPE html>
<html>
<body>

<script src="https://code.jquery.com/jquery-3.1.0.js"></script>

<script>
 var copy = function(){
  var txt = document.getElementById('txt');
  var cont = document.getElementById('container');
  cont.innerHTML = txt.value;
}  
</script>

<style>
  .btn{border:2px solid black;border-radius}  
  #btn{font-size:15px;}
  #container{
    padding:30px;
    border:2px dotted #777777;
    max-width:600px;
  }
</style>
  
<b>Example showing "bug" in Internet Explorer.</b><BR><BR>

When the content within the textarea is copied into a container by Javascript in Internet Explorer, the (max-width:xx) media query will activate even though the browser width is wider than the filter. Once the browser is adjusted slightly, it reverts to the inactive state.<BR><BR>



<button id="btn" onclick="copy()">Copy textarea HTML to container</button><BR><BR>
When the button is clicked, you will see "Replaced" with a yellow background in Internet Explorer, but blue in other browsers.<BR>

<div id="container">To be replaced...</div><BR><BR>

  Textarea (feel free to edit this below):<BR>    
  <textarea id="txt" cols=80 rows=20>
  <style>
    .foo{
      background-color: blue;
    }
    @media screen and (max-width:450px){
      .foo{
        background-color: yellow;
      }
    }
  </style>

  <div class="foo"><input type="radio" checked> Replaced</div>
  </textarea>

</body>
</html>





              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console