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.

            
              .first-face
  %span.pip
.second-face
  %span.pip
  %span.pip
.third-face
  %span.pip
  %span.pip
  %span.pip
.fourth-face
  %span.pip
  %span.pip
  %span.pip
  %span.pip
.fifth-face
  %span.pip
  %span.pip
  .row
    %span.pip
  %span.pip
  %span.pip
.sixth-face
  %span.pip
  %span.pip
  %span.pip
  %span.pip
  %span.pip
  %span.pip
            
          
!
            
              // Ordered in order of complexity!

// Change to true to show highlights
$do-highlight: false;
@mixin highlight($color) {
  @if $do-highlight { background-color: $color; }
}

.first-face {
  display: flex;
  justify-content: center;
  align-items: center;
}

.second-face {
  display: flex;
  justify-content: space-between;
  
  .pip:nth-of-type(2) {
    align-self: flex-end;
  }
}

.sixth-face {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-wrap: wrap;
  
  .pip:nth-of-type(n+4) {
    @include highlight(red);
    align-self: flex-end;
  }
}

.third-face {
  display: flex;
  
  .pip:nth-of-type(2) {
    @include highlight(blue);
    align-self: center;
  }
  .pip:nth-of-type(3) {
    @include highlight(red);
    align-self: flex-end;
  }
}

.fourth-face {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  
  .pip:nth-of-type(3) {
    // Force it onto the next line
    margin-right: 10%;
  }
  .pip:nth-of-type(n+3) {
    @include highlight(red);
    align-self: flex-end;
  }
}

.fifth-face {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  
  .row {
    display: flex;
    justify-content: space-around;
    width: 100%;
    .pip {
      @include highlight(blue);
      align-self: center;
    }
  }
  .pip:nth-of-type(n+3) {
    @include highlight(red);
    align-self: flex-end;
  }
}

/* OTHER STYLES */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  vertical-align: center;
  flex-wrap: wrap;
  align-content: center;
  font-family: 'Open Sans', sans-serif;
  
  background: linear-gradient(top, #222, #333);
}

[class$="face"] {
  margin: 16px;
  padding: 4px;
  
  background-color: #e7e7e7;
  width: 104px;
  height: 104px;
  object-fit: contain;
  
  box-shadow:
    inset 0 5px white, 
    inset 0 -5px #bbb,
    inset 5px 0 #d7d7d7, 
    inset -5px 0 #d7d7d7;
  
  border-radius: 10%;
}

.pip {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin: 4px;

  background-color: #333;
  box-shadow: inset 0 3px #111, inset 0 -3px #555;
}
            
          
!
            
              /*
This is an example from the Free Flexbox Starter Course by Landon Schropp.
https://unravelingflexbox.com/subscribe
*/
            
          
!
999px
Loading ..................

Console