Pen Settings



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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


    <p>Click the button to fire <code>eqHeight</code></p>
    <button id="fire">Click Me</button></p>
  <article class="eqHeight one"></article>
  <article class="eqHeight two"></article>
  <article class="eqHeight three"></article>
<script type="text/javascript" src=""></script>


                main {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  max-width: 1200px;
  margin: 40px auto;
  header {
    display: inline-block;
    width: 100%;
  article {
    display: inline-block;
    width: 30%;
    background: #ddd;
    &.one { height: 50px }
    &.two { height: 150px }
    &.three { height: 100px }


 * Set the height to that of the tallest element for all shared selectors
 * selector      string  querySelectorAll
 * responsive   bool    whether or not to reset height before calculating tallest
function eqHeight(selector, responsive = true) {
  var findClass = document.querySelectorAll(selector);
  // if we don't find any of the elements...back out.
  if (!findClass.length) return;
  var tallest = 0;
  var tallestHeight = 0;

  // first we have to find the tallest matching element.
  for (i = 0; i < findClass.length; i++) {
    var ele = findClass[i];
    // clear out current height so we can calculate new height.
    if(responsive) { = "";
    var eleHeight = ele.offsetHeight;
    tallest = eleHeight > tallest ? eleHeight : tallest;

    if (ele.classList.contains("anchor")) {
      tallestHeight = eleHeight;
      tallest = tallestHeight;
  console.log('test', tallest);
  // set all elements to tallest height
  for (i = 0; i < findClass.length; i++) {
    findClass[i].style.height = tallest + "px";

document.getElementById('fire').addEventListener('click', function() {
  eqHeight('.eqHeight', false); // does not reset height. called once on load