cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

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.

            
              <div class="container-fluid">
  <div class="col-xs-3 col-xs-offset-1 js-height-max">
    <h3>要素①</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias voluptatem odit a quisquam illo reiciendis nam ipsum, ea vero iure labore magni porro in est, deleniti quasi, quas, adipisci delectus!</p>
  </div>

  <div class="col-xs-3 col-xs-offset-1 js-height-max">
    <h3>要素②</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. </p>
  </div>

  <div class="col-xs-3 col-xs-offset-1 js-height-max">
    <h3>要素③</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias voluptatem odit a quisquam illo reiciendis nam ipsum, ea vero iure labore magni porro in est, deleniti quasi, quas, adipisci delectus!</p>
    <p>ea vero iure labore magni porro in est, deleniti quasi, quas, adipisci delectus!</p>

  </div>
</div>
            
          
!
            
              // DOMの読み込みが完了したら発火
window.addEventListener("DOMContentLoaded",function(){
  // 全ての「.js-height-max」を「elem」に代入
  var elem = document.getElementsByClassName("js-height-max");

  // 「h_list」にElementsの高さの配列を代入
  var h_list = getHeight(elem);

  // 「h_list」の中で最も大きい値を算出し代入
  h_list = Math.max.apply(null, h_list);

  setHeight(elem,h_list);
  
},false);

// 最も大きい値を各Elementsに付与
function setHeight(target,h){
  for(var h_i = 0;h_i<target.length;h_i++){
    target[h_i].style.height = h+"px";
  }
}

// 「target」で、DOMElementsを渡すと、そのElementsの高さを配列で返す。
function getHeight(target){
  var h = [];
  for(var h_n = 0;h_n<target.length;h_n++){
    h[h_n] = target[h_n].clientHeight;
  }
  return h;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console