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

              
                <dl>
  <dt>Users</dt>
  <dd>400+</dd>
  <dd>wearing caps</dd>
  <dd>in charge of food</dd>
  <dd>morning people</dd>
  
  <dt>Developers</dt>
  <dd>20+</dd>
  <dd>wearing hoodies</dd>
  <dd>in charge of techy stuff</dd>
  <dd>night owls</dd>
  
  <dt>Cats</dt>
  <dd>3+</dd>
  <dd>wearing fluff</dd>
  <dd>monitoring from a great height</dd>
  <dd>sleeping 23 hours a day</dd>
</dl>
              
            
!

CSS

              
                // Layout definition list like a table
// Display definition terms at the bottom,
// after the descriptions
// This means the number of terms controls 
// how many columns is displayed

$number-of-terms: 3;

// The number of descriptions must be the 
// same for all terms
// This means the number of descriptions 
// controls how many rows you end up with 

// To change the number of descriptions
// edit the HTML and the following variable: 

$number-of-descriptions: 4;

// all items flow in rows
dl {
  display: flex;
  flex-flow: row wrap;
  // keep long words from breaking layout on
  // narrow viewports
  word-break: break-word;
}

// set up all definition list children into 
// a grid with as many colummns as there are
// terms
dt,
dd {
  flex: 0 0 100%/$number-of-terms;
  // reset browser margin and padding
  // if you need non-zero horizontal values
  // rember to adjust the flex-basis above!
  margin: 0;
  padding: 0;
  width: 33.33%;
}

// display dt in the "last table row"
dt {
  order: ($number-of-descriptions + 1);
}

// place dd-s in rows according to 
// their order in HTML
@for $i from 1 through $number-of-descriptions {
  dd:nth-of-type(#{$number-of-descriptions}n + #{$i}) {
    order: #{$i};
   }
}

// —————————— Styling —————————— //

dt {
  font-style: italic;
  font-weight: bold;
  letter-spacing: 2px;
  margin-top: 1em;
  text-transform: uppercase;
}

dd {
  margin-top: .4em;
  
  &::before {
    content: "\203a\2000";
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console