cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <p>View port width: <span id="vpWidth"> </span></p>
<section class="container">
<picture>
	<!--[if IE 9]><video style="display: none;"><![endif]-->
	<source srcset="https://i.imgur.com/DHn1jum.jpg 2x, https://i.imgur.com/cH9F9yK.jpg" media="(min-width: 800px)">
  <source srcset="https://i.imgur.com/CFWnOcO.jpg 2x, https://i.imgur.com/CxCyzFa.jpg" media="(min-width: 400px)">
	<source srcset="https://i.imgur.com/JvcfcKG.jpg 2x, https://i.imgur.com/bgn3xoq.jpg">
	<!--[if IE 9]></video><![endif]-->
	<img 
       srcset="https://i.imgur.com/JOAChFS.jpg, https://i.imgur.com/DX8Y8RS.jpg 2x" alt="Images from Unsplash.com" title="A demonstration in picturefill.js">
</picture>
</container>
            
          
!
            
              %box_shadow{
  box-shadow: 10px 21px 10px rgba(0,0,0,0.03);
}
%font_sans-serif{font-family: sans-serif;}

body{
  margin:0;
  
  &::after{
    content:'';
    background: url('https://i.imgur.com/7DuoHxY.png');
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    z-index:-1;
    opacity: 0.6;
  }
}

p{
  background: rgba(255,255,255,0.4);
  text-align: center;
  padding: 5px;
  border-top: 1px solid rgba(0,0,0,0.03);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  color: #9D8BA5;
  text-shadow: 1px 1px 0 #ddd;
  @extend %box_shadow;
  @extend %font_sans-serif;
}

.container{
  max-width: 1000px;
  padding: 1em;
  margin:0 auto;
  //position:relative;
  
  picture{
    display: table;
    margin: 0 auto;
    
    img{
    max-width: 100%;
    @extend %box_shadow;
    }
  }
}
            
          
!
            
              var mediaWidth = $('#vpWidth');
$(window).load(function(){
  mediaWidth.text($(this).width());
});
$(window).resize(function(){
  mediaWidth.text($(this).width());
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console