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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                doctype
html
	title Flexbox Overview
	link(href="css/style.css", rel="stylesheet")


	body
		mixin container(number, headline)
			.example
				h2= headline
				.example-content
					div(class='parent'+number)
						div(class='item'+number) 1
						div(class='item'+number) 2
						div(class='item'+number) 3
						div(class='item'+number) 4
						div(class='item'+number) 5


		+container('2', 'display: flex')
		+container('3', 'flex-direction: row-reverse')
		+container('4', 'flex-direction: column')
		+container('5', 'flex-direction: column-reverse')
		+container('6', 'flex-wrap: wrap')
		+container('7', 'justify-content: flex-end')
		+container('8', 'justify-content: center')
		+container('9', 'justify-content: space-between')
		+container('10', 'justify-content: space-around')
		+container('11', 'align-items: flex-end')
		+container('12', 'align-items: center')
		+container('13', 'align-items: stretch')
		+container('14', 'align-items: baseline')
		+container('15', 'align-content: center')
		+container('16', 'align-content: flex-start')
		+container('17', 'align-content: flex-end')
		+container('18', 'align-content: space-around')
		+container('19', 'align-content: space-between')
		+container('20', 'align-content: center and flex-direction: column')
		+container('21', 'align-content: flex-start and flex-direction: column')
		+container('22', 'align-content: flex-end and flex-direction: column')
		+container('23', 'align-content: space-around and flex-direction: column')
		+container('24', 'align-content: space-between and flex-direction: column')
		+container('25', 'order')
		+container('26', 'flex-grow')
		+container('27', 'flex-shrink')
		+container('28', 'flex-basis')
		+container('29', 'align-self: center')
		+container('30', 'align-self: flex-end')
		+container('31', 'align-self: stretch')
              
            
!

CSS

              
                @mixin flexbox()
	display: -webkit-box
	display: -moz-box
	display: -ms-flexbox
	display: -webkit-flex
	display: flex

@mixin order($val)
	-webkit-box-ordinal-group: $val  
	-moz-box-ordinal-group: $val     
	-ms-flex-order: $val     
	-webkit-order: $val  
	order: $val

body
	font-family: monospace

.example
	padding-bottom: 50px

h2
	text-align: center
	background: skyblue
	color: white
	width: 710px
	margin: 0px auto
	padding-top: 5px

.parent
	border: 5px solid skyblue
	width: 700px
	margin: 0px auto
	@include flexbox

.item
	height: 50px
	margin: 5px
	background: salmon
	color: white
	text-align: center
	line-height: 50px
	font-weight: 600
	width: 50px


// Display Flex

.parent2
	@extend .parent

.item2
	@extend .item


// Flex-Direction: row-reverse

.parent3
	@extend .parent
	flex-direction: row-reverse

.item3
	@extend .item


// Flex-Direction: column

.parent4
	@extend .parent
	flex-direction: column

.item4
	@extend .item


// Flex-Direction: column-reverse

.parent5
	@extend .parent
	flex-direction: column-reverse

.item5
	@extend .item


// Flex-Wrap: wrap

.parent6
	@extend .parent
	flex-wrap: wrap

.item6
	@extend .item
	width: 30%


// Justify-Content: flex-end

.parent7
	@extend .parent
	justify-content: flex-end

.item7
	@extend .item


// Justify-Content: center

.parent8
	@extend .parent
	justify-content: center

.item8
	@extend .item


// Justify-Content: space-between

.parent9
	@extend .parent
	justify-content: space-between

.item9
	@extend .item


// Justify-Content: space-around

.parent10
	@extend .parent
	justify-content: space-around

.item10
	@extend .item


// Align-Items: flex-end

.parent11
	@extend .parent
	align-items: flex-end
	height: 200px

.item11
	@extend .item


// Align-Items: center

.parent12
	@extend .parent
	align-items: center
	height: 200px

.item12
	@extend .item


// Align-Items: stretch

.parent13
	@extend .parent
	align-items: stretch
	height: 200px

.item13
	@extend .item
	height: auto


// Align-Items: baseline

.parent14
	@extend .parent
	align-items: baseline
	height: 200px

.item14
	@extend .item

.item14:nth-child(3)
	font-size: 80px


// Align-Content: center

.parent15
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: center

.item15
	@extend .item
	width: 20%


// Align-Content: flex-start

.parent16
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: flex-start

.item16
	@extend .item
	width: 20%


// Align-Content: flex-end

.parent17
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: flex-end

.item17
	@extend .item
	width: 20%


// Align-Content: space-around

.parent18
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: space-around

.item18
	@extend .item
	width: 20%


// Align-Content: space-between

.parent19
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: space-between

.item19
	@extend .item
	width: 20%


// Align-Content: center AND flex-direction: column

.parent20
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: center
	flex-direction: column

.item20
	@extend .item
	width: 20%


// Align-Content: flex-start AND flex-direction: column-reverse

.parent21
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: flex-start
	flex-direction: column

.item21
	@extend .item
	width: 20%


// Align-Content: flex-end AND flex-direction: column

.parent22
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: flex-end
	flex-direction: column

.item22
	@extend .item
	width: 20%


// Align-Content: space-around AND flex-direction: column

.parent23
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: space-around
	flex-direction: column

.item23
	@extend .item
	width: 20%


// Align-Content: space-between AND flex-direction: column

.parent24
	@extend .parent
	height: 200px
	flex-wrap: wrap
	align-content: space-between
	flex-direction: column

.item24
	@extend .item
	width: 20%


// Order

.parent25
	@extend .parent
	height: 200px

.item25
	@extend .item
	width: 20%

.item25:nth-child(2)
	@include order(2)

.item25:nth-child(3)
	@include order(2)


// Flex-grow

.parent26
	@extend .parent
	height: 200px

.item26
	@extend .item

.item26:nth-child(2)
	flex-grow: 3


// Flex-shrink

.parent27
	@extend .parent
	height: 200px

.item27
	@extend .item
	width: 150px

.item27:nth-child(2)
	flex-shrink: 20


// Flex-basis

.parent28
	@extend .parent
	height: 200px

.item28
	@extend .item
	width: 150px

.item28:nth-child(2)
	flex-basis: 15px


// Align-self: center

.parent29
	@extend .parent
	height: 200px

.item29
	@extend .item
	width: 150px

.item29:nth-child(2)
	align-self: center


// Align-self: flex-end

.parent30
	@extend .parent
	height: 200px

.item30
	@extend .item
	width: 150px

.item30:nth-child(2)
	align-self: flex-end


// Align-self: stretch

.parent31
	@extend .parent
	height: 200px

.item31
	@extend .item
	width: 150px

.item31:nth-child(2)
	align-self: stretch
	height: auto
              
            
!

JS

              
                
              
            
!
999px

Console