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 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>This page is a demo of a <a href="https://github.com/yowainwright/reframe.js">Reframe.js</a> - a very basic lightweight plugin that makes iframes or any div responsive.</p>
			<p>Reframe.js makes all iframes selected responsive.</p>
			<iframe width="560" height="315" src="https://www.youtube.com/embed/6FQsIfE7sZM" frameborder="0" allowfullscreen></iframe>
			<figcaption>This is an <code>iframe</code> that contains a video.</figcaption>
              html{box-sizing:border-box;font-family:sans-serif;-webkit-text-size-adjust:2;-ms-text-size-adjust:2;text-size-adjust:2}*,:after,:before{box-sizing:inherit}body{color:#000;font-family:sans-serif;margin:0}article,figcaption,figure,footer,header,main{display:block}video{display:inline-block}[hidden]{display:none}code{font-family:monospace,monospace}select{font:inherit;margin:0;overflow:visible;text-transform:none}[type=reset],[type=submit],html [type=button]{-webkit-appearance:button}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}body,figure,h1,h2,h3,h4,h5,h6,p{margin:0;padding:0}figure,h1,h2,h3,h4,h5,h6,p{margin-bottom:.5rem}h1,h2,h3,h4,h5,h6{font-weight:400}a{background-color:transparent;color:#000;text-decoration:none}a:active,a:hover{outline-width:0}.js-reframe{padding-top:56.25%;position:relative;width:100%}.js-reframe iframe{height:100%;left:0;position:absolute;top:0;width:100%}figure,p{margin:1rem 0}figcaption{margin:.5rem 0;text-align:center}article{margin:1rem auto;max-width:calc(100% - 4rem)}@media screen and (min-width:768px){article{max-width:700px}}footer p,h1{text-align:center}footer,h1{margin:2rem auto}
              (function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global.reframe = factory());
}(this, (function () { 'use strict';

function Reframe(target, cName) {
  var frames = typeof target === 'string' ? document.querySelectorAll(target) : target;
  if (!('length' in frames)) {
    frames = [frames];
  var classname = cName || 'js-reframe';
  for (var i = 0; i < frames.length; i++) {
    var frame = frames[i];
    var hasClass = frame.className.split(' ').indexOf(classname);
    if (hasClass >= 0) return false;
    var div = document.createElement('div');
    var height = frame.offsetHeight;
    var width = frame.offsetWidth;
    var padding = height / width * 100;
    div.style.paddingTop = padding + '%';
    frame.height = frame.width = '';
    div.className += classname;
    frame.parentNode.insertBefore(div, frame);
  return this;
function reframe (target, cName) {
  return new Reframe(target, cName);

if (window.$ || window.jQuery || window.Zepto) {
  window.$.fn.reframe = function reframeFunc(cName) {
    return new Reframe(this, cName);

return reframe;



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.


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