cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="wrapper">
  
  <header>
    <h1>iModal</h1>
  </header>
  
  <section>
    <h2>The best modal ever made.</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure architecto facere et illo rem labore aliquam quia molestias ut dolorum quidem enim dolor provident odio laborum dicta obcaecati non asperiores!</p>    
    <button class="button-border toggleModal">
      <span class="icon">&#61723</span> trigger iModal</button>
  </section>
  
  <div class="modal">
    
    <header>
      <h2>Title</h2>
      <button class="close toggleModal">Close</button>
    </header>
    
    <section>
      <p>Lorem ipsum dolor sit amet, consectetur amis at adipisicing elit. Maiores quaerat est officia aut nam amet ipsum natus corporis adipisci cupiditate voluptas unde totam quae vel error neque odio id etas lasf reiciendis.</p>
    </section>
    
    <button class="button-border button-success">
      <span class="icon">&#61853</span> Download</button>
    
    <button class="button-border button-error pull-right">
      <span class="icon">&#61756 </span>Lock</button>
    
  </div>
  
</div>
            
          
!
            
              @import "compass/css3";

@import "compass/css3/shared";

@font-face {
  font-family: 'ios7-icon';
  src:
    url('https://ios7-icon-font-demo.herokuapp.com/fonts/ios7-icon.woff') format('woff'),
    url('https://ios7-icon-font-demo.herokuapp.com/fonts/ios7-icon.ttf') format('ttf');
  font-weight: normal;
  font-style: normal;
}

$blue : #007aff;
$green : #4dd865;
$red : #ff3b30;
$white : #ffffff;
$black : #000000;

*, *:before, *:after {
  -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}

body {
  padding: 50px;
  font-family: 'Helvetica Neue' !important;
  font-weight: 300;
}

.wrapper {
    max-width: 500px;
    margin: 0 auto;
}

h1 {
  font-weight: 100;
  font-size: 45px;
  color: $blue;
}

h2 {
  font-weight: 500;
  font-size: 21px;
  margin-bottom: 15px;
}

section {
  margin-top: 30px;
  
  p {
    line-height: 1.4;
    margin-bottom: 20px;
  }
}

button {
  @include experimental('appearance', 
    none, 
    webkit, moz, o, ms, not khtml);
  @include border-radius(5px);
  border: none;
  outline:none;
  font: inherit;
  cursor: pointer;
  margin: 0;
  padding: 0;
  background: $white;
  color: $blue;
  font-weight: 300;
  font-size: 16px;
  @include border-radius(0px);
  
  &:hover {
    text-decoration: underline;
  }

/*  &:last-child {
    border-color: red;
    margin-bottom: 0;
  }*/
  
  &.button-border {
    
    @include border-radius(5px);
    padding: 10px 12px 8px 12px;
    border: 1px solid $blue; 
  
    &:hover {
      background: $blue;
      color: $white;
      text-decoration: none;
    }
    
  }

  &.button-success {
    color: $green;
    border-color: $green;
    &:hover {
      background: $green;
    }
  }

  &.button-error {
    color: $red;
    border-color: $red;
    &:hover {
      background: $red;
    }
  }
  
}

.modal {
   
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 400px;
  height: auto;
  margin-left: -200px;
  margin-top: -150px;
  background-color: $white;
  padding: 25px;
  border-radius: 5px;
  z-index: 10;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  
  &.active {
    display: block;
  }
  
  header {
    position: relative;
  }

  h2 {
    text-align: center;
  }

  .close {
    position: absolute;
    top: 3px;
    right: 0;
    margin: 0;
  }


}

.pull-right {
  float: right;  
}

.icon {
  display: inline-block;
  font-size: inherit;
  font-family: 'ios7-icon';
  margin-right: 5px;
  color: inherit;
  -webkit-text-rendering: geometricPrecision;
  -moz-text-rendering: geometricPrecision;
  -ms-text-rendering: geometricPrecision;
  -o-text-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

            
          
!
            
              /*

inspiration
---
https://tympanus.net/codrops/2013/11/07/css-overlay-techniques

icons
---
https://ios7-icon-font-demo.herokuapp.com/

*/

$('.toggleModal').on('click', function (e) {
  
  $('.modal').toggleClass('active');
  
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console