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.

            
              <figure class="reflection" id="css-element">
  <img src="http://unsplash.it/300/215?image=84" alt="">
  <figcaption class="reflection-text">San Francisco, CA</figcaption>
</figure>
<svg height="0">
  <mask id="mask">
    <rect width="100%" height="215" fill="url(#gradient)"/>
    <linearGradient x1="0" y1="0" x2="0" y2="1" id="gradient">
      <stop offset="50%" stop-color="black" />
      <stop offset="100%" stop-color="white" />
    </linearGradient>
  </mask>
</svg>
            
          
!
            
              .reflection {
  position: relative;
  width: 300px;
  height: 215px;
  margin: 50px auto;
}
.reflection-text {
  font: 1.2em sans-serif;
  position: absolute;
  right: 0; bottom: 20px;
  margin: 0;
  padding: 10px;
  background: rgba(255,255,255,.6);
  color: #000;
  transition: padding .3s;
}
.reflection:hover .reflection-text {
  padding-right: 50px;
}

/* reflection the standard way (detecting support) */
@supports (background: -moz-element(#css-element)) {
  .reflection::after{
    content: '';
    position: absolute;
    left: 0; top: 100%;
    width: inherit; height: inherit;
    background: -moz-element(#css-element);
    transform: scaleY(-1);
    mask: url('#mask');
    opacity: .3;
  }
}

/* reflection the old WebKit way */
.reflection {
  -webkit-box-reflect: below 0 linear-gradient(transparent 50%, rgba(0,0,0,.3));
}
            
          
!
999px
Loading ..................

Console