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

HTML

              
                <figure class="snip0020">
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample18.jpg" alt="sample18"/>
	<figcaption>
		<div><h2>I'm just <span>very</span> selective </h2></div>
		<div>
			<p>.. bout the reality I choose to accept.</p>
			<div class="curl"></div>
		</div>
		<a href="#"></a>
	</figcaption>			
</figure>
<figure class="snip0020 hover">
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample17.jpg" alt="sample17"/>
	<figcaption>
		<div><h2>If <span>good</span> things lasted forever</h2></div>
		<div>
			<p>.. would we appreciate how precious they are?</p>
			<div class="curl"></div>
		</div>
		<a href="#"></a>
	</figcaption>			
</figure>
<figure class="snip0020">
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/331810/sample16.jpg" alt="sample16"/>
	<figcaption>
		<div><h2>To make a <span>bad day</span> worse</h2></div>
		<div>
			<p>.. spend it wishing for the impossible.</p>
			<div class="curl"></div>
		</div>
		<a href="#"></a>
	</figcaption>			
</figure>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Raleway:400,200,300,800);
figure.snip0020 {
  font-family: 'Raleway', Arial, sans-serif;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin: 10px;
  min-width: 220px;
  max-width: 310px;
  max-height: 220px;
  width: 100%;
  background: #000000;
  text-align: center;
}
figure.snip0020 * {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
figure.snip0020 img {
  opacity: 1;
  width: 100%;
  -webkit-transition: opacity 0.35s;
  transition: opacity 0.35s;
}
figure.snip0020 figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
figure.snip0020 figcaption > div {
  height: 50%;
  overflow: hidden;
  width: 100%;
  position: relative;
}
figure.snip0020 figcaption::before {
  position: absolute;
  top: 50%;
  right: 50%;
  left: 50%;
  height: 2px;
  content: '';
  opacity: 0;
  background-color: rgba(255, 255, 255, 0);
  -webkit-transition: all 0.4s;
  transition: all 0.4s;
  -webkit-transition-delay: 0.6s;
  transition-delay: 0.6s;
}
figure.snip0020 h2,
figure.snip0020 p {
  margin: 0;
  padding: 30px 35px;
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  -webkit-transition: opacity 0.4s, -webkit-transform 0.4s;
  transition: opacity 0.4s,-webkit-transform 0.4s,-moz-transform 0.4s,-o-transform 0.4s,transform 0.4s;
  -webkit-transition-delay: 0.3s;
  transition-delay: 0.3s;
}
figure.snip0020 h2 {
  display: inline-block;
  word-spacing: -0.1em;
  font-weight: 300;
  text-transform: uppercase;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, transparent 60%, rgba(0, 0, 0, 0.7) 100%);
  -webkit-transform: translate3d(0%, 50%, 0);
  transform: translate3d(0%, 50%, 0);
}
figure.snip0020 h2 span {
  font-weight: 800;
}
figure.snip0020 p {
  font-weight: 300;
  top: 0%;
  color: #000;
  background: #fff;
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, transparent 40%, rgba(0, 0, 0, 0.1) 100%);
  -webkit-transform: translate3d(0%, -50%, 0);
  transform: translate3d(0%, -50%, 0);
}
figure.snip0020 .curl {
  width: 0px;
  height: 0px;
  position: absolute;
  bottom: 0;
  right: 0;
  background: linear-gradient(135deg, #ffffff, #f3f3f3 20%, #cccccc 38%, #bbbbbb 44%, #aaaaaa 50%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0.4));
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: all .3s ease;
}
figure.snip0020 .curl:before,
figure.snip0020 .curl:after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 12%;
  bottom: 6%;
  width: 70%;
  max-width: 300px;
  max-height: 100px;
  height: 55%;
  box-shadow: 0 12px 15px rgba(0, 0, 0, 0.3);
  transform: skew(-10deg) rotate(-6deg);
}
figure.snip0020 .curl:after {
  left: auto;
  right: 6%;
  bottom: auto;
  top: 14%;
  transform: skew(-15deg) rotate(-84deg);
}
figure.snip0020 a {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: absolute;
  color: #ffffff;
}
figure.snip0020:hover img,
figure.snip0020.hover img {
  opacity: 0.7;
}
figure.snip0020:hover figcaption h2,
figure.snip0020.hover figcaption h2,
figure.snip0020:hover figcaption p,
figure.snip0020.hover figcaption p {
  -webkit-transform: translate3d(0%, 0%, 0);
  transform: translate3d(0%, 0%, 0);
  -webkit-transition-delay: 0.3s;
  transition-delay: 0.3s;
}
figure.snip0020:hover figcaption h2,
figure.snip0020.hover figcaption h2 {
  opacity: 1;
}
figure.snip0020:hover figcaption p,
figure.snip0020.hover figcaption p {
  opacity: 1;
}
figure.snip0020:hover figcaption::before,
figure.snip0020.hover figcaption::before {
  background: #ffffff;
  left: 0px;
  right: 0px;
  opacity: 1;
  -webkit-transition-delay: 0s;
  transition-delay: 0s;
}
figure.snip0020:hover figcaption .curl,
figure.snip0020.hover figcaption .curl {
  width: 40px;
  height: 40px;
  -webkit-transition-delay: 0.7s;
  transition-delay: 0.7s;
}


/* Demo purposes only */
html {
  height: 100%;
}
body {
  background-color: #212121;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  height: 100%;
}
              
            
!

JS

              
                /* Demo purposes only */	
$("figure").mouseleave(
  function () {
    $(this).removeClass("hover");
  }
);
              
            
!
999px

Console