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

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="button-group filters-button-group">
<button class="button is-checked" data-filter="*">Alle</button>
<button class="button" data-filter=".beach">Hund</button>
<button class="button" data-filter=".bird">Katze</button>
<button class="button" data-filter=".boat">Maus</button>
<button class="button" data-filter=".lighthouse">Vogel</button>
<button class="button" data-filter=".people">Haus</button>
<button class="button" data-filter=".rock">Baum</button>
<button class="button" data-filter=".sea">Blume</button>
</div>

<section id="grid-container" class="transitions-enabled fluid masonry js-masonry grid">

<article class="beach people sea">
<img src="//picsum.photos/600/300?image=49" class="img-responsive">
</article>

<article class="beach bird">
<img src="//picsum.photos/300/600?image=49" class="img-responsive">
</article>

<article class="sea">
<img src="//picsum.photos/450/300?image=49" class="img-responsive">
</article>

<article class="beach people rock sea">
<img src="//picsum.photos/300/150?image=49" class="img-responsive">
</article>

<article class="beach sea">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

<article class="bird">
<img src="//picsum.photos/658/554?image=49" class="img-responsive">
</article>

<article class="bird">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

<article class="sea">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

<article class="lighthouse rock sea">
<img src="//picsum.photos/658/454?image=49" class="img-responsive">
</article>

<article class="boat">
<img src="//picsum.photos/458/554?image=49" class="img-responsive">
</article>

<article class="lighthouse sea">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

<article class="beach people">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

<article class="rock sea">
<img src="//picsum.photos/558/454?image=49" class="img-responsive">
</article>

<article class="boat lighthouse sea">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

<article class="boat sea">
<img src="//picsum.photos/758/354?image=49" class="img-responsive">
</article>

<article class="rock sea">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

<article class="beach">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

<article class="rock sea">
<img src="//picsum.photos/258/154?image=49" class="img-responsive">
</article>

<article class="people rock sea">
<img src="//picsum.photos/658/354?image=49" class="img-responsive">
</article>

</section>
              
            
!

CSS

              
                * { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #eee; color: #222; }

.button { display: inline-block; background: #fafafa; border: 1px solid #ddd; margin: 0 0.5em; padding: 1em; }

.button:hover { background-color: rgba(0,0,0,0.1); }
.button:active, .button.is-checked { background-color: rgba(0,0,0,0.1); outline: none; }
.button-group { margin: 20px 0; text-align: center; }
.button-group:after { content: ''; display: block; clear: both; }

img { vertical-align: middle; }
.img-responsive { display: block; max-width: 100%; height: auto; }

.grid article { background: #fff; display: block; float: left; margin: 1%; width: 23%; }

@media (max-width: 1024px) { .grid article { width: 31.3%; }}
@media (max-width: 767px) { .grid article { width: 48%; }}
@media (max-width: 479px) { .grid article { margin: 2% 0; width: 100%; }}
              
            
!

JS

              
                $( function() {
  var $grid = $('.grid').isotope({
    itemSelector: 'article'
  });

  // filter buttons
  $('.filters-button-group').on( 'click', 'button', function() {
    var filterValue = $( this ).attr('data-filter');
    $grid.isotope({ filter: filterValue });
  });
  $('.button-group').each( function( i, buttonGroup ) {
    var $buttonGroup = $( buttonGroup );
    $buttonGroup.on( 'click', 'button', function() {
      $buttonGroup.find('.is-checked').removeClass('is-checked');
      $( this ).addClass('is-checked');
    });
  });
});

// debounce so filtering doesn't happen every millisecond
function debounce( fn, threshold ) {
  var timeout;
  return function debounced() {
    if ( timeout ) {
      clearTimeout( timeout );
    }
    function delayed() {
      fn();
      timeout = null;
    }
    timeout = setTimeout( delayed, threshold || 100 );
  }
}

$(window).bind("load", function() {
  $('#all').click();
});
              
            
!
999px

Console