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.

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

            
              <header>
  Header
</header>



<div class="grid">
  <div class="grid__col main">
    Article
    <article>
      <h1>Example Article</h1>
      <p>Lorem ipsum dolor sit amet fusce risus nisl, viverra et, tempor et, pretium in, sapien. Praesent turpis. Donec vitae orci sed dolor rutrum auctor. Pellentesque commodo eros a enim. Aenean ut eros et nisl sagittis vestibulum. Curabitur nisi. Phasellus a est.</p>
       <!--<img src="http://station.ch/imagecache/header_1280/station_news/teaser_lang-143.jpg">-->
<!--       <img 
           src="https://pompidou.cepheus.uberspace.de/dev/rwd-101-demo/rwd-101-small.jpg"
           sizes="calc(100vw - 2em), (min-width: 45em) calc(60vw - 2em)"
           srcset="
                  https://pompidou.cepheus.uberspace.de/dev/rwd-101-demo/rwd-101-small.jpg 483w, 
                  https://pompidou.cepheus.uberspace.de/dev/rwd-101-demo/rwd-101-large.jpg 780w"
      >-->
      <picture>
        <source srcset="https://pompidou.cepheus.uberspace.de/dev/rwd-101-demo/rwd-101-large.jpg" media="(min-width: 45em)">
        <source srcset="https://pompidou.cepheus.uberspace.de/dev/rwd-101-demo/rwd-101-small.jpg">
        <img srcset="https://pompidou.cepheus.uberspace.de/dev/rwd-101-demo/rwd-101-small.jpg">
      </picture>
      <div class="video-embed">
        <iframe width="560" height="315" src="//www.youtube.com/embed/JGmdGSCCjKA?autoplay=1" frameborder="0" allowfullscreen></iframe>
      </div>
    </article>
  </div>
  <div class="grid__col sidebar-1">
    Sidebar
  </div>
  <div class="grid__col sidebar-2">
    Advertisements
  </div>
</div>



<footer>
  Footer
</footer>
























            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Lato:300,400,300italic,400italic);










/* --- 1 --- */
/* insert article */


/* --- 4 --- */
@media all and (min-width: 45em) {


/* --- 2 --- */
/*  .grid__col {
    float: left;
  }*/
  

/* --- 3 --- */
  .sidebar-1,
  .sidebar-2 {
    width: 20%;
  }
  .main {
    width: 60%;
  }
  

/* --- 9 --- */
/* change order


/* --- 10 --- */
  .grid {
    display: flex;
  }
  

/* --- 11 --- */
  .sidebar-1 {
    order: 1;
  }
  .sidebar-2 {
    order: 3;
  }
  .main {
    order: 2;
  }
    
}


/* --- 5 --- */
/* insert image


/* --- 6 --- */
article img {
  // max-width: 100%;
  width: 100%;
}


/* --- 7 --- */
/* switch image with srcset image */


/* --- 8 --- */
/* switch image with <picture> image */


/* --- 12 --- */
/* insert youtube iframe */


/* --- 13 --- */
.video-embed {
  position: relative;
  height: 0;
  padding-top: 56.25%;
  
  iframe {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}


/* --- 14 --- */
/* show JS MQs */










* {
  font-family: 'Lato', sans-serif;
  font-weight: 300;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}

header,
footer {
  padding: 2em;
  text-align: center;
  background-color: #A0B21F;
  color: #FFF;
}
.grid {
  &:after {
    content: "";
    display: table;
    clear: both;
  }
}
.sidebar-1,
.sidebar-2,
.main {
  padding: 1em;
}
.sidebar-1,
.sidebar-2 {
  background-color: #F18800;
  color: #FFF;
}
.sidebar-1 {
  height: 15em;
}
.sidebar-2 {
  height: 10em;
}
.main {
  min-height: 30em;
   background-color: #E6E6E6;
}

h1 {
  font-weight: normal;
  letter-spacing: 2px;
  padding: 1em 0;
}
p {
  padding: 2em 0;
}
.video-embed {
  margin-bottom: 2em;
}
            
          
!
            
              $(document).ready(function() {
  
  
  var $window = $(window);
  var $header = $('header');
  
  
  var onResize = function() {
    if (window.matchMedia('(min-width: 45em)').matches) {
      $header.html('large screen');
    }
    else {
      $header.html('small screen');
    }    
  };
  
  
  onResize();
  $window.on('resize', onResize);
  
  
}());
            
          
!
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