Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

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

              
                <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>Retina.js</h1>
<p>Here is an example of how the Retina.js plugin works.</p>
    <h2>An Image.</h2>
    <figure>
<img  
  src="https://dl.dropboxusercontent.com/u/885323/photo.jpg" 
 data-at2x="https://dl.dropboxusercontent.com/u/885323/photo%402x.jpg" 
     alt="a retina image of retina.js" />
      <figcaption>This is soooo meta....</figcaption>
    </figure>
   

</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>
              
            
!

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

              
                (function() {

  var root = (typeof exports == 'undefined' ? window : exports);



  root.Retina = Retina;

  function Retina() {}

  Retina.init = function(context) {
    if (context == null) context = root;

    var existing_onload = context.onload || new Function;

    context.onload = function() {
      var images = document.getElementsByTagName("img"), retinaImages = [], i, image;
      for (i = 0; i < images.length; i++) {
        image = images[i];
        retinaImages.push(new RetinaImage(image));
      }
      existing_onload();
    }
  };

  Retina.isRetina = function(){
    var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\
                      (min--moz-device-pixel-ratio: 1.5),\
                      (-o-min-device-pixel-ratio: 3/2),\
                      (min-resolution: 1.5dppx)";

    if (root.devicePixelRatio > 1)
      return true;

    if (root.matchMedia && root.matchMedia(mediaQuery).matches)
      return true;

    return false;
  };


  root.RetinaImagePath = RetinaImagePath;

  function RetinaImagePath(path) {
    this.path = path;
    this.at_2x_path = path.replace(/\.\w+$/, function(match) { return "@2x" + match; });
  }

  RetinaImagePath.confirmed_paths = [];

  RetinaImagePath.prototype.at_2x_path_loads = function(callback) {
    var variant = new Image();
    variant.onload  = function() { return callback(true);  }
    variant.onerror = function() { return callback(false); }
    variant.src = this.at_2x_path;
  }

  RetinaImagePath.prototype.check_2x_variant = function(callback) {
    var that = this;
    if (RetinaImagePath.confirmed_paths.indexOf(this.at_2x_path) != -1) {
      return callback(true);
    } else {
      this.at_2x_path_loads(function(wasLoaded) {
        if (wasLoaded) RetinaImagePath.confirmed_paths.push(that.at_2x_path);
        return callback(wasLoaded);
      });
    }
  }



  function RetinaImage(el) {
    this.el = el;
    this.path = new RetinaImagePath(this.el.getAttribute('src'));
    var that = this;
    this.path.check_2x_variant(function(hasVariant) {
      if (hasVariant) that.swap();
    });
  }

  root.RetinaImage = RetinaImage;

  RetinaImage.prototype.swap = function(path) {
    if (typeof path == 'undefined') path = this.path.at_2x_path;

    var that = this;
    function load() {
      if (! that.el.complete) {
        setTimeout(load, 5);
      } else {
        that.el.setAttribute('width', that.el.offsetWidth);
        that.el.setAttribute('height', that.el.offsetHeight);
        that.el.setAttribute('src', path);
      }
    }
    load();
  }




  if (Retina.isRetina()) {
    Retina.init(root);
  }

})();

              
            
!
999px

Console