Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <body  data-responsejs='{     "create": [     { "breakpoints": [0,320,481,641,961,1025,1281], "mode": "src", "prefix": "src" },      { "breakpoints": [0,320,481,641,961,1025,1281], "mode": "markup", "prefix": "r" }     ]}'>
  <div class="container">
  <div class="navigation"><ul>
  <li><a href="#">Link</a></li>
  <li><a href="#">Link</a></li>
  <li><a href="#">Link</a></li>
  <li><a href="#">Link</a></li>
</ul></div>
  <div class="content">
    <h1>Response.js</h1>
<p>Response JS is a lightweight jQuery (or Zepto) plugin that gives web designers tools for building performance-optimized, mobile-first responsive websites. This is using Zepto as an example and we're loading in a few different image options below.  By default the lowest res image is included in the src, and then is swapped out depending on the size of the viewport.</p>
    <h2>Imags sizes</h2>
    <p>Load lo-fi.jpg  when viewport is 0–480px wide or no-js. 
    Load medium.jpg when viewport is 481–1024px wide. 
      Load hi-fi.jpg  when viewport is 1025px+ wide.</p>
    <figure>
<a href="https://dl.dropbox.com/u/17903022/rwd-response.js-example-large.jpg">
  <img src="https://dl.dropbox.com/u/17903022/rwd-response.js-example-small.jpg" data-src481="https://dl.dropbox.com/u/17903022/rwd-response.js-example-medium.jpg" data-src1025="https://dl.dropbox.com/u/17903022/rwd-response.js-example-large.jpg" alt="example" /></a>
      <figcaption>These are responsive images loaded with response.js</figcaption>
    </figure>
    
    
    <h2>Differnet Markup</h2>
    <p>You can also include differnet types of markup at different breakpoints.</p>
<p> Keep default when viewport is &lt;320px wide or no-js. 
    Load data-r320 when viewport is 320–960px wide. 
  Load data-r961 when viewport is 961px+ wide. </p> 

<div data-r320="markup @ 320+" data-r481="markup @ 481+" data-r641="markup @ 641+" data-r1025="markup @ 1025+" data-r1281="markup @ 1281+" data-r961="markup @ 961+">default</div>
    
    
</div>
  <div class="aside"> <h3>Aside Stuff</h3><ul>
  <li><a href="#">Similar Content</a></li>
  <li><a href="#">More stuff</a></li>
  <li><a href="#">other more stuff that goes on and on and on</a></li>
  <li><a href="#">more other stuff</a></li>
</ul></div>
  <div class="footer">Subscribe to <a href="http://responsivedesignweekly.com">Responsive Design Weekly</a></div>
</div>
</body>
              
            
!

CSS

              
                * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }

ul, li, p, html, body, h3 {
 padding: 0;
  margin: 0;
}

body {
 font-size: 16px; 
 font-family: helvetica, arial, san-serif;
 background-color: #999;
 color: #333;
}

video, embed, iframe, object, img {
  
  width: 100%;
  max-width: 100%;
  height: auto;}

h1 {
  border-top: 0.3em solid #333;
}
p {
  font-size: 1em;
  line-height:1.6em;
  margin-bottom: 2em;
}

p:first-of-type{
    margin-top: 1.6em;
}

.container {
   width: 100%;
   max-width: 64em;
  margin: 0 auto;
}

.content{
  background-color: #c84c44;
  float:left;
  width: 100%;
  padding: 5%;
}

.navigation{
  background-color: #a53d36;
  width: 100%;
  float:left;
}

.navigation ul { list-style-type: none;}

.navigation ul li {
  float:left; 
  width: 100%; 
  border-bottom: 1px solid #333; 
  height: 3em; 
  text-align: center;}
.navigation ul li a {
  line-height: 3em; 
  color: #333; 
  text-decoration: none; 
  width: 100%;
  float:left;
}

.navigation ul li:hover {
  background-color:#8e352e;
}

.aside {
  background-color: #8e352e;
  float:left;
  width: 100%;
  color: #f1f1f1;
}

.aside h3 {
  padding-left: 1.6em; 
  margin: 4em 0 0;
}
.aside ul { 
  list-style-type: none;
  margin: 1em 0 3em;
  float:left; width: 100%;
}
.aside ul li { 
  width: 100%;
  background:none; 
  border-top: 1px solid #333; 
/*  min-height: 3em; */
  padding: 0.5em 1em 1.6em; 
  text-align:left;
}
.aside ul li:last-child {
  border-bottom: none;
}
.aside ul li a {
  line-height: 1.2em; 
  color: #333; 
  text-decoration: none; 
  width: 100%;
}
.aside ul li:hover {
  background-color:#8e352e;
}

.footer{
  clear: both;
  background-color: #333333;
  width: 100%;
  height: 5em;
  float: right;
}

.footer a {
  color: #f0f0f0; 
  text-decoration: none; 
  line-height: 5em;
}
.footer a:hover {
  border-bottom: dashed 1px #999;
}


@media screen and (min-width:20em) {
 /*     20.000em /* (320 px)*/ 
   body { 
    background-color: #fff;
  }
}

@media screen and (min-width:30em) {
 /*         30.000em  /* (480 px)*/
 body { 
    background-color: #f1f1f1;
  }
}
  
@media screen and (min-width:31.25em) {
 /*     31.250em  /* (500 px)*/
  
 .navigation  ul { 
    list-style-type: none;
  }
.navigation ul li {
    float:left; 
    width: 25%;
    background:none; 
    border-right: 1px solid #333; 
    height: 3em; 
    text-align: center;
  }
  
.navigation ul li:last-child {
    border-right: none;
  }
  
.navigation ul li a {
    line-height: 3em; 
    color: #333; 
    text-decoration: none; 
    width: 100%;
    float:left;
  }
  
ul li:hover {
    background-color:#8e352e;
  }

}  
@media screen and (min-width: 37.5em) {
 /*   	37.500em  /* (600 px)*/
  
}
@media screen and (min-width:48em) {
 /*   	48.000em /*(ackkkkkk, device specific bad)768px*/
  
}
@media screen and (min-width:50em) {
 /*   	50.000em  /* (800 px)*/
  .content{
  width: 80%;
  padding: 5%;
}
  
 .aside {
   width: 20%; 
  }
  
}
@media screen and (min-width:60em) {
 /*   	60.000em /*(a designers fav)960px */
    .container {
  margin: 5em auto;
}
} 

@media screen and (min-width:64em) {
 /*   	64.000em /* (ackkkkk) 1024px */

} 
@media screen and (min-width:75em) {
 /*   	75.000em  /* (1200 px)*/
  
}  
  
  
@media screen and (min-width:87.5em) {
 /* 	87.500em  /* (1400 px)*/
/*  body {
    font-size: 1.1em;
  }*/
    
}  
  
@media screen and (min-width:100em) {
 /*   		100.000em  /* (1600 px)*/
  body {
    font-size: 1.4em;
  }
}  
  
      
  
  

		
		
		
		
		
	
	


              
            
!

JS

              
                /*! response.js 0.7.11 | responsejs.com | MIT License 2014 Ryan Van Etten */
(function(h,p,u){var v=h.jQuery||h.Zepto||h.ender||h.elo;"undefined"!=typeof module&&module.exports?module.exports=u(v):h[p]=u(v)})(this,"Response",function(h){function p(a){throw new TypeError(a?q+"."+a:q);}function u(a){return"number"==typeof a&&a===a}function v(a,b,c){for(var f=[],e=a.length,d=0;d<e;)f[d]=b.call(c,a[d],d++,a);return f}function C(a){return a?t("string"==typeof a?a.split(" "):a):[]}function l(a,b,c){if(null==a)return a;for(var f=a.length,e=0;e<f;)b.call(c||a[e],a[e],e++,a);return a}
function Q(a,b,c){null==b&&(b="");null==c&&(c="");for(var f=[],e=a.length,d=0;d<e;d++)null==a[d]||f.push(b+a[d]+c);return f}function t(a,b,c){var f,e,d,r=[],h=0,g=0,l="function"==typeof b,k=!0===c;e=a&&a.length;for(c=k?null:c;g<e;g++)d=a[g],f=l?!b.call(c,d,g,a):b?typeof d!==b:!d,f===k&&(r[h++]=d);return r}function R(a,b){if(null==a||null==b)return a;if("object"==typeof b&&u(b.length))ra.apply(a,t(b,"undefined",!0));else for(var c in b)sa.call(b,c)&&void 0!==b[c]&&(a[c]=b[c]);return a}function w(a,
b,c){if(null==a)return a;"object"==typeof a&&!a.nodeType&&u(a.length)?l(a,b,c):b.call(c||a,a);return a}function D(a){return function(b,c){var f=a();return f>=(b||0)&&(!c||f<=c)}}function x(a){var b=k.devicePixelRatio;if(null==a)return b||(x(2)?2:x(1.5)?1.5:x(1)?1:0);if(!isFinite(a))return!1;if(b&&0<b)return b>=a;a="only all and (min--moz-device-pixel-ratio:"+a+")";return S(a).matches?!0:!!S(a.replace("-moz-","")).matches}function aa(a){return a.replace(T,"$1").replace(ta,function(a,c){return c.toUpperCase()})}
function E(a){return"data-"+(a?a.replace(T,"$1").replace(ua,"$1-$2").toLowerCase():a)}function ba(a){var b;return a&&"string"==typeof a?"true"===a?!0:"false"===a?!1:"undefined"===a?b:"null"===a?null:(b=parseFloat(a))===+b?b:a:a}function F(a){return a?1===a.nodeType?a:a[0]&&1===a[0].nodeType?a[0]:!1:!1}function G(a,b){var c,f=arguments.length,e=F(this),d={},r=!1;if(f){ca(a)&&(r=!0,a=a[0]);if("string"===typeof a){a=E(a);if(1===f)return d=e.getAttribute(a),r?ba(d):d;if(this===e||2>(c=this.length||1))e.setAttribute(a,
b);else for(;c--;)c in this&&G.apply(this[c],arguments)}else if(a instanceof Object)for(c in a)a.hasOwnProperty(c)&&G.call(this,c,a[c]);return this}if(e.dataset&&DOMStringMap)return e.dataset;l(e.attributes,function(a){a&&(c=String(a.name).match(T))&&(d[aa(c[1])]=a.value)});return d}function da(a){this&&"string"===typeof a&&(a=C(a),w(this,function(b){l(a,function(a){a&&b.removeAttribute(E(a))})}));return this}function H(a){return G.apply(a,va.call(arguments,1))}function ea(a,b){return da.call(a,b)}
function fa(a){for(var b,c=[],f=0,e=a.length;f<e;)(b=a[f++])&&c.push("["+E(b.replace(U,"").replace(".","\\."))+"]");return c.join()}function V(a,b){var c=a.getBoundingClientRect?a.getBoundingClientRect():{};b="number"==typeof b?b||0:0;return{top:(c.top||0)-b,left:(c.left||0)-b,bottom:(c.bottom||0)+b,right:(c.right||0)+b}}function W(a,b){var c=V(F(a),b);return!!c&&0<=c.bottom&&c.top<=I()&&0<=c.right&&c.left<=J()}function ga(a){var b={img:1,input:1,source:3,embed:3,track:3,iframe:5,audio:5,video:5,
script:5}[a.nodeName.toLowerCase()]||-1;return 4>b?b:null!=a.getAttribute("src")?5:-5}function ha(a,b,c){var f;a&&null!=b||p("store");c="string"==typeof c&&c;w(a,function(a){f=c?a.getAttribute(c):0<ga(a)?a.getAttribute("src"):a.innerHTML;null==f?ea(a,b):H(a,b,f)});return g}function X(a,b){var c=[];a&&b&&l(C(b),function(b){c.push(H(a,b))},a);return c}function Y(a){y.on("resize",a);return g}function ia(a){w(a,function(a){"object"==typeof a||p("create @args");var c=Z(ja).configure(a),f,e=c.verge;a=c.breakpoints;
var d=K("scroll"),r=K("resize");a.length&&(f=a[0]||a[1]||!1,L(function(){function a(){c.reset();l(c.$e,function(a,b){c[b].decideValue().updateDOM()}).trigger(g)}function b(){l(c.$e,function(a,b){W(c[b].$e,e)&&c[b].updateDOM()})}var g=$.allLoaded,h=!!c.lazy;l(c.target().$e,function(a,b){c[b]=Z(c).prepareData(a);h&&!W(c[b].$e,e)||c[b].updateDOM()});c.dynamic&&(c.custom||f<z)&&Y(a,r);h&&(y.on(d,b),c.$e.one(g,function(){y.off(d,b)}))}))});return g}function wa(a,b,c){l(["inX","inY","inViewport"],function(f){!c&&
b[f]||(b[f]=function(b,c){return a(t(this,function(a){return!!a&&!c===g[f](a,b)}))})})}function ka(a,b){if("function"==typeof a&&a.fn){if(b||void 0===a.fn.dataset)a.fn.dataset=G;if(b||void 0===a.fn.deletes)a.fn.deletes=da;wa(a,a.fn,b)}return g}if("function"!=typeof h)try{console.log("Response was unable to run due to missing dependency.")}catch(Da){}var g,M=this,q="Response",xa=M[q],la="init"+q,k=window,ma=document,n=ma.documentElement,L=h.domReady||h,y=h(k),A=k.screen,m=Array.prototype,B=Object.prototype,
ra=m.push,va=m.slice,ya=m.concat,za=B.toString,sa=B.hasOwnProperty,ca=Array.isArray||function(a){return"[object Array]"===za.call(a)},na={width:[0,320,481,641,961,1025,1281],height:[0,481],ratio:[1,1.5,2]},ja,m={},s={},oa={},N={all:[]},Aa=1,O=A.width,P=A.height,z=O>P?O:P,Ba=O+P-z,pa=function(){return O},qa=function(){return P},Ca=/[^a-z0-9_\-\.]/gi,U=/^[\W\s]+|[\W\s]+$|/g,ua=/([a-z])([A-Z])/g,ta=/-(.)/g,T=/^data-(.+)$/,Z=Object.create||function(a){function b(){}b.prototype=a;return new b},K=function(a,
b){b=b||q;return a.replace(U,"")+"."+b.replace(U,"")},$={allLoaded:K("allLoaded"),crossover:K("crossover")},S=k.matchMedia||k.msMatchMedia||function(){return{}},J=n.clientWidth<k.innerWidth?function(){return k.innerWidth}:function(){return n.clientWidth},I=n.clientHeight<k.innerHeight?function(){return k.innerHeight}:function(){return n.clientHeight},A=D(J),B=D(I);m.band=D(pa);m.wave=D(qa);ja=function(){function a(a){return"string"==typeof a?a.toLowerCase().replace(Ca,""):""}var b=$.crossover,c=Math.min;
return{$e:0,mode:0,breakpoints:null,prefix:null,prop:"width",keys:[],dynamic:null,custom:0,values:[],fn:0,verge:null,newValue:0,currValue:1,aka:null,lazy:null,i:0,uid:null,reset:function(){for(var a=this.breakpoints,c=a.length,d=0;!d&&c--;)this.fn(a[c])&&(d=c);d!==this.i&&(y.trigger(b).trigger(this.prop+b),this.i=d||0);return this},configure:function(b){R(this,b);var e,d,g=!0;e=this.prop;this.uid=Aa++;null==this.verge&&(this.verge=c(z,500));this.fn=s[e]||p("create @fn");null==this.dynamic&&(this.dynamic=
"device"!==e.slice(0,6));this.custom=oa[e];d=this.prefix?t(v(C(this.prefix),a)):["min-"+e+"-"];b=1<d.length?d.slice(1):0;this.prefix=d[0];d=this.breakpoints;ca(d)?(l(d,function(a){if(!a&&0!==a)throw"invalid breakpoint";g=g&&isFinite(a)}),d=g?d.sort(function(a,b){return a-b}):d,d.length||p("create @breakpoints")):d=na[e]||na[e.split("-").pop()]||p("create @prop");this.breakpoints=g?t(d,function(a){return a<=z}):d;this.keys=Q(this.breakpoints,this.prefix);this.aka=null;if(b){d=[];for(e=b.length;e--;)d.push(Q(this.breakpoints,
b[e]));this.aka=d;this.keys=ya.apply(this.keys,d)}N.all=N.all.concat(N[this.uid]=this.keys);return this},target:function(){this.$e=h(fa(N[this.uid]));ha(this.$e,la);this.keys.push(la);return this},decideValue:function(){for(var a=null,b=this.breakpoints,c=b.length,g=c;null==a&&g--;)this.fn(b[g])&&(a=this.values[g]);this.newValue="string"===typeof a?a:this.values[c];return this},prepareData:function(a){this.$e=h(a);this.mode=ga(a);this.values=X(this.$e,this.keys);if(this.aka)for(a=this.aka.length;a--;)this.values=
R(this.values,X(this.$e,this.aka[a]));return this.decideValue()},updateDOM:function(){if(this.currValue===this.newValue)return this;this.currValue=this.newValue;0<this.mode?this.$e[0].setAttribute("src",this.newValue):null==this.newValue?this.$e.empty&&this.$e.empty():this.$e.html?this.$e.html(this.newValue):(this.$e.empty&&this.$e.empty(),this.$e[0].innerHTML=this.newValue);return this}}}();s.width=A;s.height=B;s["device-width"]=m.band;s["device-height"]=m.wave;s["device-pixel-ratio"]=x;g={deviceMin:function(){return Ba},
deviceMax:function(){return z},noConflict:function(a){M[q]===g&&(M[q]=xa);"function"==typeof a&&a.call(M,g);return g},chain:function(a,b){a=arguments.length?a:h;return ka(a,b)},bridge:ka,create:ia,addTest:function(a,b){"string"==typeof a&&"function"==typeof b&&(s[a]=b,oa[a]=1);return g},datatize:E,camelize:aa,render:ba,store:ha,access:X,target:function(a){return h(fa(C(a)))},object:Z,crossover:function(a,b){var c,f=$.crossover;"function"==typeof a&&(c=b,b=a,a=c);y.on(a?""+a+f:f,b);return g},action:function(a){w(a,
function(a){L(a);Y(a)});return g},resize:Y,ready:L,affix:Q,sift:t,dpr:x,deletes:ea,scrollX:function(){return window.pageXOffset||n.scrollLeft},scrollY:function(){return window.pageYOffset||n.scrollTop},deviceW:pa,deviceH:qa,device:m,inX:function(a,b){var c=V(F(a),b);return!!c&&0<=c.right&&c.left<=J()},inY:function(a,b){var c=V(F(a),b);return!!c&&0<=c.bottom&&c.top<=I()},route:w,merge:R,media:S,wave:B,band:A,map:v,each:l,inViewport:W,dataset:H,viewportH:I,viewportW:J};L(function(){var a=H(ma.body,
"responsejs"),b=k.JSON&&JSON.parse||h.parseJSON;(a=a&&b?b(a):a)&&a.create&&ia(a.create);n.className=n.className.replace(/(^|\s)(no-)?responsejs(\s|$)/,"$1$3")+" responsejs "});return g});
              
            
!
999px

Console