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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <h2>align-items: flex-start;</h2>
<div class="flex-container flex-start">
	<div class="flex-item">Item 1</div>
	<div class="flex-item">Item 2</div>
	<div class="flex-item">Item 3</div>
	<div class="flex-item">Item 4</div>
</div>

<h2>align-items: flex-end;</h2>
<div class="flex-container flex-end">
	<div class="flex-item">Item 1</div>
	<div class="flex-item">Item 2</div>
	<div class="flex-item">Item 3</div>
	<div class="flex-item">Item 4</div>
</div>

<h2>align-items: center;</h2>
<div class="flex-container center">
	<div class="flex-item">Item 1</div>
	<div class="flex-item">Item 2</div>
	<div class="flex-item">Item 3</div>
	<div class="flex-item">Item 4</div>
</div>

<h2>align-items: stretch;</h2>
<div class="flex-container stretch">
	<div class="flex-item">Item 1</div>
	<div class="flex-item">Item 2</div>
	<div class="flex-item">Item 3</div>
	<div class="flex-item">Item 4</div>
</div>

<h2>align-items: baseline;</h2>
<div class="flex-container baseline">
	<div class="flex-item">Item 1</div>
	<div class="flex-item">Item 2</div>
	<div class="flex-item">Item 3</div>
	<div class="flex-item">Item 4</div>
</div>
            
          
!
            
              /* Flex Container */
.flex-start {
	display: flex;
	align-items: flex-start;
}
.flex-end {
	display: flex;
	align-items: flex-end;
}
.center {
	display: flex;
	align-items: center;
}
.stretch {
	display: flex;
	align-items: stretch;
}
.baseline {
	display: flex;
	align-items: baseline;
}

/* global container */
.flex-container {
	background: #def;
	height: 6em;
}
/* global items */
.flex-item {
	background: gray;
	color: white;
	text-align: center;
	padding: 0.5em;
	border: 1px solid black;
	box-sizing: border-box;
	flex-basis: 25%;
}

/* Baseline flex-item */
.baseline .flex-item:nth-child(1) {
	padding:2em 0;
}
.baseline .flex-item:nth-child(2) {
	padding:0.5em;
}
.baseline .flex-item:nth-child(3) {
	padding:2em 0 1em;
}
.baseline .flex-item:nth-child(4) {
	padding:1em 0 2em;
}

/* global styles */
h2 {
	text-align:center;
	margin: 1em 0 0;
}
            
          
!
999px
Loading ..................

Console