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

              
                <div class="int-flex">
  <div class="int-grid4">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada suscipit tellus id maximus. Duis metus mauris, tristique vel leo ultrices, varius venenatis libero. Ut malesuada, quam a mattis tempus, leo ligula viverra mi, posuere maximus nulla
    mauris a sem. Proin blandit, velit non congue tempor, nulla diam consectetur elit, a laoreet risus magna vel felis. Aliquam tristique nisi urna, et euismod augue venenatis vehicula. Aenean vitae auctor arcu. Suspendisse consequat gravida metus sed
    fringilla. Vestibulum at vehicula metus. Suspendisse at nunc sit amet nisi auctor elementum in porttitor augue. Fusce viverra felis quis tempor venenatis. Aliquam turpis ipsum, commodo vitae commodo rhoncus, ornare nec tellus. Integer vulputate ligula
    sit amet augue aliquam varius. Aliquam in dapibus elit. Fusce molestie cursus lacus, a posuere ex. </div>

  <div class="int-grid4">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce malesuada suscipit tellus id maximus. Duis metus mauris, tristique vel leo ultrices, varius venenatis libero. Ut malesuada, quam a mattis tempus, leo ligula viverra mi, posuere maximus nulla
    mauris a sem. Proin blandit, velit non congue tempor, nulla diam consectetur elit, a laoreet risus magna vel felis. Aliquam tristique nisi urna, et euismod augue venenatis vehicula. Aenean vitae auctor arcu. Suspendisse consequat gravida metus sed
    fringilla. Vestibulum at vehicula metus. Suspendisse at nunc sit amet nisi auctor elementum in porttitor augue. Fusce viverra felis quis tempor venenatis. Aliquam turpis ipsum, commodo vitae commodo rhoncus, ornare nec tellus. Integer vulputate ligula
    sit amet augue aliquam varius. Aliquam in dapibus elit. Fusce molestie cursus lacus, a posuere ex. </div>

  <div class="int-grid4">
    <p>Suspendisse vitae turpis eu dui scelerisque pellentesque. Donec nec massa et eros molestie dictum nec id ipsum. Nunc interdum sed quam vulputate tempor. Quisque interdum, mi ut scelerisque varius, justo lorem iaculis lorem, a ultrices massa lorem
      at turpis. Phasellus at quam in sem maximus gravida quis sed augue. Integer commodo commodo felis non placerat. Pellentesque molestie enim aliquam ex tempor, ut ornare elit lobortis. Integer ultricies nunc sit amet porttitor consectetur.</p>
    <p>
    Phasellus finibus felis odio. Sed congue dui ligula, et vulputate tellus venenatis in. Nunc in purus placerat, auctor sem vel, ultrices lacus. Pellentesque eu arcu ac odio pharetra dictum quis volutpat magna. Donec eros diam, luctus non quam sit amet,
      placerat commodo libero. Donec vitae nibh vestibulum, luctus sem sit amet, dapibus sapien. </p>
  </div>

</div>
              
            
!

CSS

              
                .int-flex {
  display: flex;
  
  > .int-grid4 {
    border: 2px solid blue;
    padding:10px;
    box-sizing:border-box;
    &:first-child {
      border-color: red;
    }
    &:last-child {
      border-color: red;
    }
  }
}

@media screen and (max-width:600){
  .int-flex {
  display: block;
  }
}
              
            
!

JS

              
                //function to call
  function displayFlex(el, colNum) {

    // check if flex is not supported and the window is greater then the min-width CSS property of the element
    if (typeof $(el).css('flex') == 'undefined') {

      //Get the longest height
      var heightTop = 0;
      for (var i = 0; i < $(el).length; i++) {
        $($(el)[i]).height() > heightTop ? heightTop = $($(el)[i]).height() : '';
      };

      //Set the height and width
      $(el).height(heightTop);
      if (typeof colNum == 'undefined')
        colNum = $(el).length
      $(el).width((100 / colNum) + '%');

    } else {

      //remove height and width property
      $(el).height('');
      $(el).width('');

    }
  }

var flexElement = '.int-flex > .int-grid4';
$(document).ready(function() {
  displayFlex(flexElement);
});
$(window).resize(function() {
  displayFlex(flexElement);
});
              
            
!
999px

Console