css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="smart-popin" id="popin1">
	  <div class="sp-table">
		    <div class="sp-cell">

			      <div class="sp-body">
				        <h2>Hey, I'm the supa Popin !</h2>
				        <img src="http://lorempixel.com/g/1199/120/" alt="placeholder img" />
				        <ul>
            <li>responsive</li>
            <li>x/y centered</li>
            <li>scrollable when viewport is too tight</li>
            <li>100% css (no js around here)</li>
            <li>easy to customize</li>
				        </ul>
				        <a href="#" class="sp-close">×</a>
			      </div>

			      <a href="#" class="sp-back"></a>

		    </div>
	  </div>
</div>


<div class="website-content">
  <h2># Pure CSS Smart Popin</h2>
  <p>
    <a href="#popin1" class="open-popin">open the popin</a>
  </p>
  <p>We love javascript but why to use it when not necessary ?!</p>
  <p>Open the popin and resize your window to test it.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit, cupiditate ipsam consequuntur esse ipsum soluta assumenda debitis laborum incidunt reiciendis animi, at eaque, fuga amet. Nesciunt impedit alias laborum recusandae. Aperiam, animi, expedita. Recusandae optio aperiam assumenda molestias reprehenderit fugiat quia deserunt amet, rem, cupiditate itaque nisi eveniet, quod pariatur. Numquam exercitationem debitis cumque placeat voluptate ab. Nemo, incidunt praesentium. Harum nemo consequuntur voluptate officiis, hic dolorum neque sint laboriosam adipisci excepturi, obcaecati maiores quo illo magni quos placeat eveniet molestiae iste vero nam. Rerum distinctio voluptate exercitationem tempora maxime.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero saepe eius magnam iusto. Esse reiciendis sapiente quis consectetur, nostrum voluptas illum, ad tempora corporis deleniti voluptatum voluptates provident culpa nesciunt?</p>
    <p>Quibusdam velit in maiores ad eaque enim beatae sunt, accusamus laudantium voluptate officia laboriosam culpa minima possimus distinctio necessitatibus tempora inventore nisi tenetur, voluptates voluptatibus omnis commodi quo iure impedit. Similique explicabo, quae id et veniam omnis, voluptatem magnam at modi aliquid illum neque sed quidem ipsa provident odit sunt delectus saepe culpa officiis nostrum a impedit accusamus! Ipsam, libero. Fugit ea soluta magnam fuga eos, quam neque, modi repellat ex, officia alias libero! Ratione, reprehenderit aspernatur tenetur officia cum unde. Deserunt impedit quos iusto quod, sequi dolor eligendi praesentium.</p>
    <p>Quam soluta fugit iure ducimus assumenda beatae accusamus et, vitae ullam recusandae id ut maxime amet nulla sapiente quo alias suscipit nam nesciunt eos aliquid, ipsam sint tenetur! Quibusdam, vero. Ipsum, temporibus. Expedita aliquam incidunt iure quas, optio quisquam, tenetur tempore quae, facere velit amet enim ipsam id fugiat! Obcaecati quos iste neque magni. Voluptatem soluta aliquid mollitia obcaecati molestiae?</p>
    <p>Fugit ea soluta magnam fuga eos, quam neque, modi repellat ex, officia alias libero! Ratione, reprehenderit aspernatur tenetur officia cum unde. Deserunt impedit quos iusto quod, sequi dolor eligendi praesentium. Alias corporis assumenda ducimus natus, fuga commodi eligendi cum, labore recusandae aut tempore nam eveniet deserunt eum, possimus, temporibus et. Dolore architecto numquam laboriosam qui maxime rem, odio veniam excepturi.</p>
    <p>Quam soluta fugit iure ducimus assumenda beatae accusamus et, vitae ullam recusandae id ut maxime amet nulla sapiente quo alias suscipit nam nesciunt eos aliquid, ipsam sint tenetur! Quibusdam, vero. Quibusdam velit in maiores ad eaque enim beatae sunt, accusamus laudantium voluptate officia laboriosam culpa minima possimus distinctio necessitatibus tempora inventore nisi tenetur, voluptates voluptatibus omnis commodi quo iure impedit.</p>
    <p>Quibusdam velit in maiores ad eaque enim beatae sunt, accusamus laudantium voluptate officia laboriosam culpa minima possimus distinctio necessitatibus tempora inventore nisi tenetur, voluptates voluptatibus omnis commodi quo iure impedit. Similique explicabo, quae id et veniam omnis, voluptatem magnam at modi aliquid illum neque sed quidem ipsa provident odit sunt delectus saepe culpa officiis nostrum a impedit accusamus! Ipsam, libero. Fugit ea soluta magnam fuga eos, quam neque, modi repellat ex, officia alias libero! Ratione, reprehenderit aspernatur tenetur officia cum unde. Deserunt impedit quos iusto quod, sequi dolor eligendi praesentium.</p>
    <p>Fugit ea soluta magnam fuga eos, quam neque, modi repellat ex, officia alias libero! Ratione, reprehenderit aspernatur tenetur officia cum unde. Deserunt impedit quos iusto quod, sequi dolor eligendi praesentium. Alias corporis assumenda ducimus natus, fuga commodi eligendi cum, labore recusandae aut tempore nam eveniet deserunt eum, possimus, temporibus et. Dolore architecto numquam laboriosam qui maxime rem, odio veniam excepturi. Quam soluta fugit iure ducimus assumenda beatae accusamus et, vitae ullam recusandae id ut maxime amet nulla sapiente quo alias suscipit nam nesciunt eos aliquid, ipsam sint tenetur! Quibusdam, vero. Quibusdam velit in maiores ad eaque enim beatae sunt, accusamus laudantium voluptate officia laboriosam culpa minima possimus distinctio necessitatibus tempora inventore nisi tenetur, voluptates voluptatibus omnis commodi quo iure impedit.</p>
</div>
            
          
!
            
              .smart-popin {
    position: fixed;
    left: 0; right: 0;
    top: 0; bottom: 0;
    overflow: auto; /* scrollbar will appear if the viewport is too tight to display all the popin content */
    opacity: 0;
    visibility: hidden;
  
    /* design */
  
    background-color: rgba(0,0,0,0.5);
    -webkit-transition: all 0.4s ease;
    -moz-transition: all 0.4s ease;
    -ms-transition: all 0.4s ease;
    -o-transition: all 0.4s ease;
    transition: all 0.4s ease;
}
.smart-popin:target {
    opacity: 1;
    visibility: visible;
}
.smart-popin .sp-table {
    display: table;
    height: 100%;
    width: 100%;
}
.smart-popin .sp-cell {
    display: table-cell;
    vertical-align: middle;
    padding: 10px; /* this space is important to let the box-shadow exceed around the popin - so it has to be at least equal to the shadow radius */
}
.smart-popin .sp-body {
    position: relative; /* to allow absolute positionning inside */
    z-index: 1; /* to ensure the popin body will be over the .sp-back layer */
    width: auto; /* by default the width of the wider element inside */
    min-width: 300px;  /* standard width for xs smartphones (320px) minus 2*10px (.sp-cell margins) */
    margin: 0 auto;
  
    /* design */
  
    background-color: #ffffff;
    padding: 2em;
    -webkit-box-shadow: 0 3px 5px 1px rgba(0,0,0,0.25);
    box-shadow: 0 3px 5px 1px rgba(0,0,0,0.25);
    width: 66.66%; /* 66.66 looks good :-) */;
}
.smart-popin .sp-body * {
    max-width: 100%; /* this is a security to prevents wide elements such as img to stretch the popin beyond the viewport width */
}
.smart-popin .sp-back { /* only used to get clicks out of the popin body */
    position: fixed;
    left: 0; right: 0;
    top: 0; bottom: 0;
    display: block;
}
.smart-popin .sp-close {
    position: absolute;
    top: 0;
    right: 0;

    width: 36px;
    height: 36px;

    text-align: center;
    line-height: 36px;
    font-size: 1.6em;
    color: #000000;
    font-weight: 900;
    text-decoration: none;
}



/* misc */

.website-content {
    max-width: 980px;
    padding: 20px;
    margin: 0 auto;
}
.open-popin {
    display: inline-block;
    text-align: center;
    color: #ffffff;
    text-decoration: none;
    background-color: crimson;
    padding: 0.5em 1.5em;
    border-radius: 20px;
    margin-bottom: 0.8em;
}
html {
  background: #f2f2f2;
}
img {
    max-width: 100%;
    width: 100%\9; /* this is a hack for IE9 since min-width won't work */
}
h2 { margin-top: 0; }
p { margin-top: 0; }
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console