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

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

              
                <main role="main">
  <h1>Font Name<!-- Replace with your font name. --></h1>

  <section class="body-size">
    <h2>Size Comparison</h2>
    <div class="body-size-grid">
      <h3>Font Name<!-- Replace with your font name. --></h3>
      <p>Body</p>
    </div>
    <div class="body-size-grid">
      <h3>Verdana</h3>
      <p>Body</p>
    </div>
    <div class="body-size-grid">
      <h3>Georgia</h3>
      <p>Body</p>
    </div>
    <div class="body-size-grid">
      <h3>Arial</h3>
      <p>Body</p>
    </div>
    <div class="body-size-grid">
      <h3>Times</h3>
      <p>Body</p>
    </div>
  </section>

  <section class="text-sample">
    <h2>Text Sample <span>&#8211; CSS font-size (px)</span></h2>
    <table>
      <tr>
        <td></td>
        <td id="element"><span id="w2"></span>px<span id="h2"></span><button id="toggle">+ Toggle 45&ndash;75 character count range.</button></td>
      </tr>
      <tr class="s34">
        <td>34</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
      <tr class="s30">
        <td>30</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
      <tr class="s28">
        <td>28</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
      <tr class="s26">
        <td>26</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
      <tr class="s24">
        <td>24</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
      <tr class="s22">
        <td>22</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
      <tr class="s20">
        <td>20</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
      <tr class="s18">
        <td>18</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
      <tr class="s16">
        <td>16</td>
        <td><p class="character-count">Is not the best kind of originality that which comes after a sound apprenticeship? That which shall prove to be the blending of a firm conception of, &#8220;useful precedent&#8221;&hellip;</p></td>
      </tr>
    </table>
  </section>

  <section class="characters">
    <h2>Characters</h2>
    <p class="s82">
   A&#8201;B&#8201;C&#8201;D&#8201;E&#8201;F&#8201;G&#8201;H&#8201;I&#8201;J&#8201;K&#8201;L&#8201;M&#8201;N&#8201;O&#8201;P&#8201;Q&#8201;R&#8201;S&#8201;T&#8201;U&#8201;V&#8201;W&#8201;X&#8201;Y&#8201;Z<br>
    a&#8201;b&#8201;c&#8201;d&#8201;e&#8201;f&#8201;g&#8201;h&#8201;i&#8201;j&#8201;k&#8201;l&#8201;m&#8201;n&#8201;o&#8201;p&#8201;q&#8201;r&#8201;s&#8201;t&#8201;u&#8201;v&#8201;w&#8201;x&#8201;y&#8201;z<br>

    1&#8201;2&#8201;3&#8201;4&#8201;5&#8201;6&#8201;7&#8201;8&#8201;9&#8201;0&#8201;&amp;&#8201;@ . , ? ! &hellip; : ; &mdash; &ndash; &lsquo; &rsquo; &ldquo; &rdquo; &Prime; &prime;(&#8201;) $ &copy; &trade;  
    </p>
  </section>

  <section class="grayscale">
    <h2>Grayscale <span>&#8211; CSS Hex Color</span></h2>
    <table class="grayscale-white">
      <tr>
        <td>#000</td>
        <td class="c000">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
      </tr>
      <tr>
        <td>#333</td>
        <td class="c333">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
      </tr>
      <tr>
        <td>#666</td>
        <td class="c666">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
      </tr>
      <tr>
        <td>#999</td>
        <td class="c999">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
      </tr>
      <tr>
        <td>#CCC</td>
        <td class="cccc">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
      </tr>
     </table>
     <table class="grayscale-black">
      <tr>       
        <td class="cfff">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
        <td>#FFF</td>
      </tr>
      <tr>
        <td class="cccc">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
        <td>#CCC</td>
      </tr>
      <tr>
        <td class="c999">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
        <td>#999</td>
      </tr>
      <tr>
        <td class="c666">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
        <td>#666</td>
      </tr>
      <tr>
        <td class="c333">The best kind of originality is that which comes after a sound apprenticeship, that which shall prove to be the blending of a firm conception of useful precedent and the progressive tendencies of an able mind. For, let a man be as able and original as he may, he cannot afford to.</td>
        <td>#333</td>
      </tr>
    </table>
  </section>

  <section class="font-size">
  <h2>Size <span>&#8211; CSS font-size (px)</span></h2>
    <table>
      <tr>
        <td>64</td> 
        <td class="s64">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>56</td> 
        <td class="s56">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>48</td> 
        <td class="s48">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>42</td> 
        <td class="s42">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>36</td> 
        <td class="s36">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>30</td> 
        <td class="s30">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>24</td> 
        <td class="s24">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>21</td> 
        <td class="s21">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>18</td> 
        <td class="s18">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>16</td> 
        <td class="s16">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
      <tr>
        <td>14</td> 
        <td class="s14">
          <p>Pack my box with five dozen liquor jugs.</p>
          <p>Pack my box with five dozen liquor jugs.</p>
        </td>
      </tr>
    </table>
  </section>
</main>
<div id="viewport"><span id="w"></span>px &times; <span id="h"></span>px</div>
              
            
!

CSS

              
                /* THIS IS WHERE YOU WILL MAKE YOUR CHANGES */




/* STOP!!!!!!! DO NOT DELETE OR CHANGE ANYTHING BELOW THIS LINE!!!!!!! */
[role="main"] {
  padding: 1em; 
}

h1 {
  font-size: 3rem;
  margin-top: 0;
}

h2 {
  color: #be0000;
  font-family: Verdana, sans-serif;
  font-size: 16px;
  font-weight: normal;
}

h2 span {
  color: #9e9e9e;
}

.text-sample td p {
  margin-bottom: 1.5rem;
  margin-top: -.15em;
}

.text-sample tr td:first-child,
.grayscale-white tr td:first-child,
.grayscale-black tr td:nth-child(2),
.font-size tr td:first-child {
  color: #9e9e9e;
  font-family: verdana, sans-serif;
  font-size: 12px;
  padding-right: .75rem;
  vertical-align: top;
}

.s82 { font-size: 82px; }
.s72 { font-size: 72px; }
.s64 { font-size: 64px; }
.s56 { font-size: 56px; }
.s48 { font-size: 48px; }
.s42 { font-size: 42px; }
.s36 { font-size: 36px; }
.s34 { font-size: 34px; }
.s32 { font-size: 32px; }
.s30 { font-size: 30px; }
.s28 { font-size: 28px; }
.s26 { font-size: 26px; }
.s24 { font-size: 24px; }
.s22 { font-size: 22px; }
.s20 { font-size: 20px; }
.s18 { font-size: 18px; }
.s16 { font-size: 16px; }
.s14 { font-size: 14px; }

.c000 { color: #000; }
.c333 { color: #333; }
.c666 { color: #666; }
.c999 { color: #999; }
.cccc { color: #ccc; }
.cfff { color: #fff; }

.characters p {
  margin-top: 0;
}

.body-size:after {
  content: "";
  display: table;
  clear: both;
}

.body-size-grid {
  float: left;
  line-height: 1;
  margin-bottom: 1em;
  width: 50%;
}

.body-size-grid:nth-child(3) {
  font-family: Verdana, sans-serif;
}

.body-size-grid:nth-child(4) {
  font-family: Georgia, serif;
}

.body-size-grid:nth-child(5) {
  font-family: Arial, sans-serif;
}

.body-size-grid:nth-child(6) {
  font-family: Times, serif;
  margin-bottom: 0;
}

.body-size-grid h3 {
  color: #9e9e9e;
  font-family: Verdana, sans-serif;
  font-size: 14px;
  font-weight: normal;
  margin: .25em 0;
}

.body-size-grid p {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1932025/font-specimen-grid.gif');
  font-size: 70px;
  line-height: 1;
  margin: 0;
  padding-bottom: 16px;
}

.grayscale td {
  font-size: 18px;
  vertical-align: top;
}

.grayscale-white,
.grayscale-black {
  border-collapse: collapse;
  border-spacing: 0;
}

.grayscale-white tr td,
.grayscale-black tr td {
  padding: .5rem;
}

.grayscale-white tr td:first-child {
  padding-left: 0;
}

.grayscale-black tr td:nth-child(2) {
  padding-right: 0;
  text-align: right;
}

.grayscale-black tr td:first-child {
  background-color: #000;
}

.font-size td {
  vertical-align: top;
}

.font-size p:first-child {
  margin: 0;
  text-transform: uppercase;
  vertical-align: top;
}

.font-size p:nth-child(2) {
  margin-top: .25em;
}

@media (min-width: 960px) {
  [role="main"] {
    padding: 4vw; 
  }

  .text-sample {
    float: left;
    width: 60%;
  }

  .characters {
    box-sizing: border-box;
    float: left;
    padding-left: 4rem;
    width: 40%;  
  }

  .body-size {
    float: left;
    width: 100%;
  }

  .body-size-grid {
    margin-bottom: 0;
    width: 20%;
  }

  .grayscale,
  .font-size {
    margin-top: 4rem;
  }

  .grayscale {
    float: left;
  }

  .grayscale-white,
  .grayscale-black {
    float: left;
    width: 50%;
  }

  .font-size {
    float: left;
    width: 100%;
  }
}

@media (min-width: 1280px) {
  [role="main"] {
    padding: 8vw; 
  }
}

.highlight {
  background-color: rgba(194, 240, 177, 0.35);
}

.highlight-off .highlight {
  background-color: transparent;
}

#viewport, #element {
  background-color: rgb(194, 240, 177);
  color: #000;
  font-family: 'Courier New', Courier, monospace;
  padding: 3px 5px 2px 5px;
}

#viewport {
  border-bottom-left-radius: 8px;
  font-size: 1.25em;
  right: 0;
  text-align: center;
  top: 0;
  position: fixed;
}

#element {
  font-size: 1em;
}

.text-sample h2 {
  margin-bottom: 1.5rem;
}

.text-sample tr:nth-child(2)  td {
  padding-top: 1rem;
}

#h2 {
  display: none;
}

#toggle {
  background-color: rgb(194, 240, 177);
  border: none;
  color: #000;
  float: right;
  font-family: 'Courier New', Courier, monospace;
  font-weight: normal;
  transition: all 300ms ease-in-out;
}

#toggle:hover {
  cursor: pointer;
  font-weight: bold;
  transition: all 300ms ease-in-out;
}
              
            
!

JS

              
                // Avoid `console` errors in browsers that lack a console.
(function() {
    var method;
    var noop = function () {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
        'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});

    while (length--) {
        method = methods[length];

        // Only stub undefined methods.
        if (!console[method]) {
            console[method] = noop;
        }
    }
}());

// Place any jQuery/helper plugins in here.
function getViewPort(){
	$w = document.getElementById('w'),
	$h = document.getElementById('h');
	$w2 = document.getElementById('w2');
	$h2 = document.getElementById('h2');
	viewPortHeight = document.documentElement.clientHeight;
	viewPortWidth = document.documentElement.clientWidth;
	elementHeight = document.getElementById('element').clientHeight;
	elementtWidth = document.getElementById('element').clientWidth;
	
	$w2.innerHTML = elementtWidth;
	$h2.innerHTML = elementHeight;
	$w.innerHTML = viewPortWidth;
	$h.innerHTML = viewPortHeight; 
	window.onresize = function(event) {
		elementHeight = document.getElementById('element').clientHeight;
		elementtWidth = document.getElementById('element').clientWidth;
		viewPortHeight = document.documentElement.clientHeight;
		viewPortWidth = document.documentElement.clientWidth;
		$w.innerHTML = viewPortWidth;
		$h.innerHTML = viewPortHeight;
		$w2.innerHTML = elementtWidth;
		$h2.innerHTML = elementHeight;
		};
}getViewPort();

(function() {
    var eles = document.getElementsByClassName("character-count");
    for (var i = 0; i < eles.length; i++) {
        highlight(eles[i]);
    }
})();

function highlight(ele) {
    var str= ele.innerHTML;
    var str1 = "";
    for(var i = 45; i < 75; i++) {
        str1 += str[i];
    }
    var n=str.replace(str1,'<span class="highlight">' + str1 + '</span>');
    ele.innerHTML=n;
}

function togglehighlight() {
    if (!document.body.classList.contains('highlight-off'))
        document.body.classList.add('highlight-off');
    else
        document.body.classList.remove('highlight-off');
}

document.getElementById("toggle").addEventListener("click", togglehighlight);
              
            
!
999px

Console