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

              
                <body>
<div class="modal">
  <input id="modal" type="checkbox" name="modal" tabindex="1">
  <label for="modal" >Launch Modal</label>
  <div class="modal__overlay">
    <div class="modal__box">
      <label for="modal">&#10006;</label>
      <h2>This is your modal content</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ac laoreet elit. Phasellus dignissim purus vitae urna cursus, quis congue ligula tristique. Ut nec blandit risus. Donec at orci ut justo venenatis viverra. Suspendisse in volutpat lacus. In enim est, dapibus eget ipsum sed, suscipit ultrices diam.</p>
    </div>
  </div>
</div>
<div class="wrap">
  <h1>Pure CSS Accessible Fullscreen Modal Popup</h1>
  <div class="css-script-ads"></div>
    <div class="css-script-clear"></div>
  </div>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifend, neque quis porta venenatis, neque dui vulputate eros, non pellentesque lorem leo eu sem. Vivamus semper lectus sit amet ipsum fermentum tincidunt. Fusce sit amet nisi pulvinar, luctus nulla in, volutpat diam. Fusce sit amet nunc elit. Sed at lorem consectetur, convallis lectus et, placerat arcu. Ut eu magna quis arcu ultrices aliquam vel quis tortor. Morbi vel rutrum ligula, in laoreet sapien.</p>
  <p>Nam ultrices dignissim sapien, eu euismod elit ornare ut. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sem orci, rhoncus ac mi et, gravida tincidunt mi. Pellentesque ac iaculis urna, ut mollis enim. In eleifend mauris turpis, interdum ultricies mi interdum eleifend. Fusce tristique, elit nec ornare tempor, nibh nulla vehicula eros, sed accumsan dui est vitae arcu. Duis ut sem efficitur, imperdiet diam ac, mattis nisi.</p>
  <p>Aliquam quis orci tempor, iaculis quam at, commodo elit. Ut varius, diam vel finibus consectetur, tellus dolor cursus nisi, vel pulvinar nisl massa eu urna. Quisque pharetra rhoncus mauris, in pulvinar libero suscipit et. Proin interdum sodales elit, eget feugiat erat venenatis a. In sit amet urna sem. Maecenas vitae metus sed augue consequat auctor. Nam mollis nunc at metus consequat, non faucibus purus tempus. Morbi non aliquam lorem. Mauris vel lacus viverra odio fermentum efficitur lacinia eget ante. In ultrices, tellus eu rhoncus accumsan, lacus nisi rutrum leo, eget aliquam nisi nibh nec tellus. Pellentesque pretium et purus sit amet sodales. Curabitur varius eros magna, ac porttitor nibh molestie sit amet. Duis eleifend neque quis ultricies volutpat. Nulla sem sem, tempor eget commodo at, cursus sed sem. Proin vitae eleifend purus. Aliquam sed rhoncus elit.</p>
  <p>Nam hendrerit sapien eget lectus auctor ornare. Quisque commodo metus vel ligula pellentesque, eu tempor dolor porta. Nunc sodales sollicitudin lectus, vitae venenatis lacus faucibus ac. In a faucibus tortor, eu ultricies tellus. Donec ullamcorper eros consequat, maximus urna eget, dictum est. Integer quis dui at augue rhoncus convallis. Nunc eget iaculis mauris. Sed quis ultricies nisi. Integer posuere porttitor iaculis. Sed bibendum vestibulum vehicula. Vivamus imperdiet orci sit amet sollicitudin efficitur. Donec porttitor mattis molestie. Interdum et malesuada fames ac ante ipsum primis in faucibus. Morbi egestas mi ac nisi blandit, sed ultrices nisl suscipit.</p>
  <p>Phasellus eleifend id dolor accumsan tincidunt. Nam lobortis eros in porttitor elementum. Phasellus congue euismod quam in condimentum. Integer arcu metus, consectetur et quam in, tempor laoreet erat. Donec rhoncus iaculis dui vel placerat. Curabitur pellentesque venenatis leo, id gravida ipsum viverra ut. Nam dui justo, elementum id leo ut, porttitor vehicula velit. Curabitur bibendum, mauris a imperdiet molestie, urna libero tempus nisl, eget dapibus tortor lacus ac ligula. Phasellus vulputate ex nec ullamcorper cursus. Sed a lobortis enim, at condimentum sem. Praesent quis fringilla erat. Maecenas lacinia cursus faucibus. Phasellus vel arcu non nibh tincidunt hendrerit. Donec at eros pulvinar, porta mi a, faucibus sem. Duis sed pulvinar ante, vel interdum enim. Sed faucibus pulvinar tincidunt.</p>
</div>
</body>

              
            
!

CSS

              
                body {
  background: #FFDE16;
  overflow-x: hidden;
  font-family: 'roboto', sans-serif
}

.wrap { padding: 1em; }
@media (min-width: 43.75em) {

.wrap { padding: 2em; }
}

.modal {
  display: block;
  padding: 0 1em;
  text-align: center;
  width: 100%;
}
@media (min-width: 43.75em) {

.modal {
  padding: 1em 2em;
  text-align: right;
}
}

.modal > label {
  background: #000;
  border-radius: .2em;
  color: #FFDE16;
  cursor: pointer;
  display: inline-block;
  font-weight: bold;
  margin: 0.5em 1em;
  padding: 0.75em 1.5em;
  -webkit-transition: all 0.55s;
  transition: all 0.55s;
}

.modal > label:hover {
  -webkit-transform: scale(0.97);
  -ms-transform: scale(0.97);
  transform: scale(0.97);
}

.modal input {
  position: absolute;
  right: 100px;
  top: 30px;
  z-index: -10;
}

.modal__overlay {
  background: black;
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  text-align: center;
  top: 0;
  z-index: -800;
}

.modal__box {
  padding: 1em .75em;
  position: relative;
  margin: 1em auto;
  max-width: 500px;
  width: 90%;
}
@media (min-height: 37.5em) {

.modal__box {
  left: 50%;
  position: absolute;
  top: 50%;
  -webkit-transform: translate(-50%, -80%);
  -ms-transform: translate(-50%, -80%);
  transform: translate(-50%, -80%);
}
}
@media (min-width: 50em) {

.modal__box { padding: 1.75em; }
}

.modal__box label {
  background: #FFDE16;
  border-radius: 50%;
  color: black;
  cursor: pointer;
  display: inline-block;
  height: 1.5em;
  line-height: 1.5em;
  position: absolute;
  right: .5em;
  top: .5em;
  width: 1.5em;
}

.modal__box h2 {
  color: #FFDE16;
  margin-bottom: 1em;
  text-transform: uppercase;
}

.modal__box p {
  color: #FFDE16;
  text-align: left;
}

.modal__overlay {
  opacity: 0;
  overflow: hidden;
  -webkit-transform: scale(0.5);
  -ms-transform: scale(0.5);
  transform: scale(0.5);
  -webkit-transition: all 0.75s cubic-bezier(0.19, 1, 0.22, 1);
  transition: all 0.75s cubic-bezier(0.19, 1, 0.22, 1);
}

input:checked ~ .modal__overlay {
  opacity: 1;
  -webkit-transform: scale(1);
  -ms-transform: scale(1);
  transform: scale(1);
  -webkit-transition: all 0.75s cubic-bezier(0.19, 1, 0.22, 1);
  transition: all 0.75s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 800;
}

input:focus + label {
  -webkit-transform: scale(0.97);
  -ms-transform: scale(0.97);
  transform: scale(0.97);
}
              
            
!

JS

              
                
              
            
!
999px

Console