cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

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.

            
              <section class="container" ng-controller="FlexboxCtrl as $ctrl">
  <h2 class="text-center">Wrapper <code>justify-content: <select class="inpu-sm" ng-options="option as option.name for option in $ctrl.justifyOptions track by option.id" ng-model="$ctrl.justifyContent"></select> ;</code></h2>
  <p class="text-center">Try this sample in full view and add at least two more elements for "space-around" and "space-between" differences!</p>
  <ul class="c-blurbs list-unstyled justify-content__{{$ctrl.justifyContent.name}}">
    <li class="c-blurbs__item" ng-repeat="blurb in $ctrl.blurbs track by $index">
      <figure>
        <img class="c-blurbs__item__img" src="http://old.oguzgelal.com/frontend/assets/img/toptal_icon.png" alt="Blurb subject">
        <figcaption>
          <h4>Some blurb element</h4>
          <p>Lorem ipsum dolor sit amet.</p>
          <button class="btn btn-danger btn-block" ng-click="$ctrl.removeElement($index)"><i class="glyphicon glyphicon-trash"></i></button>
        </figcaption>
      </figure>
    </li>
  </ul>
  <button class="btn btn-success btn-block" ng-click="$ctrl.addElement()"><i class="glyphicon glyphicon-plus"></i></button>
</section>
            
          
!
            
              $blue: #3863A0;
$green: #3DBE8B;

.c-blurbs{
  display: flex;
  flex-wrap: wrap;
  text-align: center;
  
  &.justify-content{
    &__flex-start{justify-content: flex-start;}
    &__flex-end{justify-content: flex-end;}
    &__center{justify-content: center;}
    &__space-around{justify-content: space-around;}
    &__space-between{justify-content: space-between;}
  }
  
  &__item{
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
    
    width: calc(33.33% - 60px); // Due to issues with IE and box-sizing: border-box this is the best workaround
    padding: 30px;
    box-sizing: content-box;
    position: relative;
    
    &__img{
      max-width: 40px;
    }
    
    figure{
      margin: 0;
    }
    
    .btn-danger{
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      opacity: 0;
      transition: all 200ms;
    }
    
    &:hover{
      .btn-danger{
        opacity: 1;
      } 
    }
    
    @media only screen and (max-width: 768px) and (min-width: 641px){
      width: calc(50% - 60px);
    }
    
    @media only screen and (max-width: 640px){
      width: calc(100% - 60px);
    }
  }
}
            
          
!
            
              (function(angular){
  'use strict';
  
  // Define app and elements
  angular.module("flexbox", ['ngSanitize'])
    // Flexbox controller (called from the component)
    .controller('FlexboxCtrl', FlexboxCtrl);

  // Dependencies injections
  //FlexboxCtrl.$inject = [];

  // Flexbox controller (hoists)
  function FlexboxCtrl(){
    var $ctrl = this;
    
    $ctrl.justifyOptions = [
      {id: 1, name: "flex-start"},
      {id: 2, name: "flex-end"},
      {id: 3, name: "center"},
      {id: 4, name: "space-around"},
      {id: 5, name: "space-between"}
    ];
    
    $ctrl.justifyContent = $ctrl.justifyOptions[0];
    
    $ctrl.blurbs = [
      '','','','',''
    ]    
    
    $ctrl.removeElement = removeElement;
    $ctrl.addElement = addElement;
    
    function removeElement(index){
      $ctrl.blurbs.splice(index, 1);
    }
    
    function addElement(){
      $ctrl.blurbs.push('');
    }
  }
  
  // Run app
  angular.bootstrap(document, ['flexbox']);
})(angular)



            
          
!
999px
Loading ..................

Console