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 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.

Quick-add: + add another resource

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.

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.

            
              <label class="hero button" for="lightbox-1">Launch Lightbox</label>


<aside class="lightbox">
  <input type="checkbox" class="state" id="lightbox-1" />
  <article class="content">
    <header class="header">
      <h3 class="h h3">Lorem Ipsum</h3>
      <label class="button" for="lightbox-1">&times;</label>
    </header>
    <main class="main">
      <p>
      Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
      </p>
       <p>
      Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
      </p>
       <p>
      Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
      </p>
    </main>
    <footer class="footer">
      <button class="button" type="button">Do something</button>
      <label class="button" for="lightbox-1">Close</label>
    </footer>
  </article>
  <label class="backdrop" for="lightbox-1"></label>
</aside>
            
          
!
            
              *{
  box-sizing: border-box;
}
html,
body{
  font-family: "Helvetica Neue", Helvetica, Arial;
  font-size: 15px;
  margin: 0;
  padding: 0;
  background: #5ec792;
}
.h{
  margin-top: 0;
}
.button{
  display: inline-block;
  margin: 0;
  padding: 10px 15px;
  background-color: #5ec792;
  border: none;
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  transition: .3s all ease-in-out;
  &:hover{
    box-shadow: inset 0 -2.5px rgba(0,0,0,.4);
  }
}
.hero{
  position: absolute;
  top: 50%;
  left: 50%;
  color: rgba(0,0,0,.4);
  border: 1px solid rgba(0,0,0,.4);
  transform: translate3d(-50%, -50%, 0);
}
.state{
  position: absolute;
  top: 0;
  left: -100vw;
  &:checked{
    ~ .content{
      transform: none;
    }
    ~ .backdrop{
      bottom: 0;
      opacity: 1;
      z-index: 1;
    }
  }
}
.lightbox{
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 0;
  padding: 0 20px;
  .content{
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 2;
    max-width: 500px;
    max-height: 95vh;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    transform: translateY(-200%);
    transition: .3s transform ease-in-out;
    border: 1px solid rgba(0,0,0,.1);
  }
  .header,
  .footer{
    display: flex;
    flex-shrink: 0;
    align-items: center;
    .h{
      margin: 0;
    }
    .button:not(:first-child){
      margin-left: auto;
    }
  }
  .header{
    padding-bottom: 10px;
  }
  .footer{
    padding-top: 20px;
  }
  .main{
    flex-grow: 1;
    overflow: scroll;
  }
  .backdrop{
    position: fixed;
    z-index: -1;
    top: 0;
    right: 0;
    bottom: 100%;
    left: 0;
    opacity: 0;
    background: rgba(0,0,0,.3);
    transition: .3s opacity ease-in-out;
  }
}
            
          
!
999px
Loading ..................

Console