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>If by using repeated hex notation, do we evenly divide the grey space from #000000 to #ffffff? - See more at: <a href="http://geekraj.com/wordpress/?p=816" target="_win">http://geekraj.com/wordpress/?p=816</a></p>

<h3><a href="http://geekraj.com/wordpress/?p=816">Shades of Grey</a></h3>

<p>Writing #333, #666, #aaa etc.</p>
<div class="top">
</div>

<p>Computed interpolation:</p>
<div class="bottom">
</div>
            
          
!
            
              body {
  margin: 10px 0 0 30px;  
}

.swatch {
  float: left;
  width: 30px;
  height: 80px;
}

.top, .bottom {
  height: 80px;
}

.bottom {
  clear: both;
  margin-top: 10px;
}


            
          
!
            
              

for (var i=0; i<16; i++) {
  var color = new Number(i).toString(16);
  color = '#' + color + color + color;
  $('.top').append('<div class="swatch" style="background:' + color +'"></div>');
}

for (var i=0; i<16; i++) {
  var color = new Number(Math.floor(255.0/15*i)).toString(16);
  color = '#' + color + color + color;
  $('.bottom').append('<div class="swatch" style="background:' + color +'"></div>');
}
            
          
!
999px
Loading ..................

Console