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

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

              
                <div class="container">
  <div class="simple-modal" tabindex="0">
		<div class="simple-modal__content">
			<header>
				<h4>Title</h4>
				<span>close</span>
			</header>
			<div class="modal-main">
        <h4>This is a pure CSS responsive modal (style only) using flexbox and no media queries. This is style only, no JS behavior added.</h4>
        <p>
Bacon ipsum dolor amet prosciutto spare ribs pork loin leberkas short loin. Ham hock picanha pork chop flank ribeye porchetta cow tri-tip turkey sausage chuck drumstick turducken. Bacon pancetta ham hock tri-tip burgdoggen brisket chicken meatball. Ground round spare ribs ham fatback pastrami tri-tip ham hock, corned beef pork belly ball tip short ribs hamburger meatloaf beef.

Prosciutto beef ribs alcatra, hamburger picanha chicken capicola shankle swine bresaola turducken. Brisket bresaola pig leberkas fatback tri-tip chuck pork drumstick turducken ham hock ground round. Shankle bacon pancetta salami. T-bone jowl beef sausage biltong, short loin fatback landjaeger tri-tip shoulder hamburger. Andouille pancetta sirloin, pork chop strip steak boudin hamburger leberkas sausage bacon.

Filet mignon cow cupim pig buffalo ham turducken biltong boudin bacon ribeye swine sausage. Hamburger bacon beef meatball pork chop, alcatra jerky tongue ribeye bresaola ball tip kielbasa turkey. Short loin tri-tip picanha andouille alcatra spare ribs kevin landjaeger corned beef tail pancetta pork chop. Pork chop flank hamburger picanha capicola ground round ball tip, chicken andouille porchetta corned beef cupim bacon. Beef ribs leberkas ribeye shankle corned beef rump.

Jerky tongue capicola pork belly, cow cupim boudin. Drumstick pork boudin kielbasa pork loin, chuck rump shankle. Frankfurter ham bacon tongue cow. Chicken turducken capicola leberkas, tenderloin tri-tip ball tip. Capicola burgdoggen tenderloin turducken, salami ribeye ham hock porchetta pork sausage.

Capicola kielbasa shank ham hock, ground round ham cupim chuck brisket short ribs andouille hamburger turkey. Bacon tongue fatback turducken shankle, beef jowl short loin tail picanha sirloin pig strip steak meatloaf tenderloin. Beef alcatra tongue, buffalo hamburger pancetta prosciutto biltong boudin spare ribs brisket ground round corned beef kevin short ribs. Spare ribs pork belly tenderloin boudin leberkas bresaola brisket strip steak swine meatball tri-tip.         
        </p>
			</div>
			<footer>
        <button>Button</button>
			</footer>
		</div>
	</div>
</div>
              
            
!

CSS

              
                .simple-modal {
  --gutter: 14px;
  --modal-color: #800000;
  --soft-color: #fafafa;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  position: fixed;
  background-color: rgba(0,0,0,.7);
  padding-top: 2%;
  &__content {
    width: 95vw;
    height: 90vh;
    max-height: 700px;
    max-width: 600px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    margin: 0 auto;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    header {
      min-height: 60px;
      height: 60px;
      color: #ffffff;
      background-color: var(--modal-color);
      display: grid;
      padding-left: var(--gutter);
      align-items: center;
      grid-template-columns: auto 60px;
      h4 {
        margin: 0;
        text-align: left;
      }
      span {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        width: 100%;
        font-size: 20px;
        opacity: .8;
        cursor: pointer;
        &:hover {
          opacity: 1;
        }
      }
    }
    .modal-main {
      flex: 1;
      text-align: left;
      overflow: auto;
      padding: var(--gutter);
    }
    footer {
      height: auto;
      text-align: right;
      border-top: solid 1px #cccccc;
      padding: var(--gutter);
      background-color: #ffffff;
      background-color: var(--soft-color);
      button, input {
        margin: 0;
        &:not(:last-child) {
          margin-right: var(--gutter);
        }
      }
    }
  }
}

// just an eye candy

.container {
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-repeat: no-repeat;
  background-image: url(http://picsum.photos/2000);
}
              
            
!

JS

              
                
              
            
!
999px

Console