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

              
                <div class="modal">
  <button>Click Here to open the Modal</button>
  <input type="radio" class="open" name="modal-controller-1"/>
  <div class="pop-up">
    <input type="radio" class="close" name="modal-controller-1" checked /><i></i>
    <h1>Here's our modal!</h1>
    <p>You can place any markup in here or change the css of <code>.pop-up</code> to customize your modal. Just make sure you leave <code>position</code> set to <code>fixed</code>.</p>
    <p>Make the default styling of <code>.pop-up</code> the model's closed state and make your adjustments for the "open" state inside of <code>.open:checked + .pop-up</code>.</p>
  </div>
</div>
              
            
!

CSS

              
                @import compass

$main: rgba( 250, 253, 255, 1 )
$accent: rgba( 255, 80, 90, 1 )
$dark: rgba( 56,67,89,1 )

html , body
  background-color: shade( $main , 2% )
  text-align: center
  position: absolute
  overflow: hidden
  height: 100%
  width: 100%
  
  *
    font-family: sans-serif
    color: $dark
    font-weight: 100
    letter-spacing: 0.03em
  
.modal
  display: inline-block
  position: relative
  margin-top: -39px
  top: 50%
  
    
  .open , .close
    outline: none
    opacity: 0
    -webkit-appearance: none
    -moz-appearance: none
    appearance: none
    
  button
    outline: none
    border: none
    position: relative
    padding: 15px
    margin: 15px
    background-color: $dark
    color: $main
    z-index: 1
    
  .open
    position: absolute
    cursor: pointer
    top: 0
    left: 0
    width: 100%
    height: 100%
    z-index: 2
    
    &:checked + .pop-up
      @include transform( translate( -50% , -50% ) scale( 1 ))
      opacity: 1

  .pop-up
    @include transform( translate( -50% , -50% ) scale( 0 ))
    @include transition( all 0.2s ease-in-out )
    opacity: 0
    background-color: $main
    text-align: left
    position: fixed
    top: 50%
    left: 50%
    width: 400px
    height: auto
    padding: 20px
    z-index: 2
    
    h1 , p 
      text-align: left
      line-height: 27px
        
      code
        padding: 6px 0
        margin: 0 6px
        box-shadow: -6px 0 0 tint( $dark , 90% ) , 6px 0 0 tint( $dark , 90% )
        background-color: tint( $dark , 90% )
        font-family: monospace
        font-size: 11px
    
    .close , i
      cursor: pointer
      position: absolute
      width: 30px
      height: 30px
      right: 10px
      top: 10px
      
    .close
      z-index: 2
      
    i
      z-index: 1
      
      &:before , &:after
        content: ""
        position: absolute
        width: 20px
        height: 5px
        top: 50%
        left: 50%
        margin-top: -2px
        margin-left: -10px
        background-color: $accent
        
      &:before
        @include rotate( -45deg )
      
      &:after
        @include rotate( 45deg )
              
            
!

JS

              
                
              
            
!
999px

Console