cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

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.

            
              <ul class="d-flex d-ex5">
								<li>
									Flex shrink: 1,<br />
									Flex basis: 200px
								</li>
								<li>
									Flex Shrink: 2,<br />
									Flex basis: 200px
				
								</li>
								<li>
									Flex Shrink: 3,<br />
									Flex basis: 200px
									
								</li>
								<li>
									Flex Shrink 1,<br />
									Flex basis: 200px
								</li>


							</ul>
            
          
!
            
              //stylesheet for flexbox navigation

.d-flexbox-navigation {
  
	background:#484281;
	border:1px solid #111;
	padding:1em;

}
.d-flexbox-navigation ul {
	
	display:flex;
	flex:1 1 20%;

	flex-direction:row;
	align-items:center;
	justify-content:center;
	transition:all 0.4s ease-in-out;

}
.d-flexbox-navigation li {
	
	display:flex;
	flex:1 1 20%;
	align-items:center;
	justify-content:flex-start;
	transition:all 0.4s ease-in-out;
	
}
.d-flexbox-navigation li a {

	border:1px solid #111;
	padding:1.5em;
	display:block;
	background:#fff;
	border-radius:3px;
	text-decoration:none;
	text-align:center;
	color: #333;
	width:100%;
	transition:all 0.4s ease-in-out;

	&:hover {
		
		background:#a303cb;
		color:#fff;
	}

}

.d-flex {

	display:flex;
	margin:0 auto;
	box-sizing:border-box;
	align-items:stretch;
}
.d-flex li {

	color:#fff;
	display:flex;
	list-style:none;
	justify-content:center;
	align-items:center;
	padding:1em;
}
.d-flex li:nth-of-type(1){

	background:#484281;

}
.d-flex li:nth-of-type(2){

	background:#5248af;

}
.d-flex li:nth-of-type(3){

	background:#786bfa;

}
.d-flex li:nth-of-type(4){

	background:#aba3f9;

}
.d-flex li:nth-of-type(5){
	background:#a303cb;
}


.d-ex1 {

	max-width:600px;

}

.d-ex2 {

	max-width:600px;

}

.d-ex3 {

	max-width:1000px;

}
.d-ex4 {

	max-width:1000px;

}
.d-ex5 {

	max-width:600px;

}
.d-ex6 {
	max-width:600px;
}

// example 1

.d-ex1 li:nth-of-type(1) { 

	flex:2 0 100px;
}


.d-ex1 li:nth-of-type(2) {

	flex:0 0 150px;

}

.d-ex1 li:nth-of-type(3) {

	flex:2 0 100px;
	
}


//example 2

.d-ex2 li:nth-of-type(1){

	flex:2 0 150px;

}
.d-ex2 li:nth-of-type(2){


	flex:0 0 150px;

}
.d-ex2 li:nth-of-type(3){

	flex:2 0 100px;
}

// example 3

.d-ex3 li:nth-of-type(1) {

	flex:3 0 0;

}
.d-ex3 li:nth-of-type(2) {

	flex: 1 0 0;

}
.d-ex3 li:nth-of-type(3){
	
	flex:2 0 0;
}

//example 4

.d-ex4 li:nth-of-type(1){

	flex:1 0 150px;

}
.d-ex4 li:nth-of-type(2){

	flex:3 0 200px;

}
.d-ex4 li:nth-of-type(3){

	flex:2 0 175px;
}
.d-ex4 li:nth-of-type(4){

	flex:4 0 225px;

}

//example 5

.d-ex5 li:nth-of-type(1){

	flex:1 1 200px;

}
.d-ex5 li:nth-of-type(2){
	
	flex:3 2 200px;

}
.d-ex5 li:nth-of-type(3){

	flex:2 3 200px;

}
.d-ex5 li:nth-of-type(4){

	flex:4 1 200px;


}

//example 6

.d-ex6 li:nth-of-type(1){

	flex:1 1 150px;

}
.d-ex6 li:nth-of-type(2){
	
	flex:3 2 400px;

}
.d-ex6 li:nth-of-type(3){

	flex:2 3 400px;

}
.d-ex6 li:nth-of-type(4){

	flex:4 0 200px;


}




.is-removing {

	animation: flexRemove 0.5s 0.5s ease forwards 1;

}

.is-adding {

	animation: flexInsert 0.5s 0.5s ease forwards 1;

}

@keyframes flexInsert {

	0% {

		transform:scale(0);

	}
	70% {

		transform:scale(1.05);

	}
	80% {
		transform:scale(0.95);
	}

	100% {
		transform:scale(1)

	}
}

@keyframes flexRemove {

	0% {

		transform:scale(1);

	}
	

	100% {
		transform:scale(0)

	}
}
            
          
!
            
              //200/1
//200/2
//200/3
//200/1
//limit is 600
//200 over

//1/7 * 200
//28.57
//200 - 28.57 = 171.43
//Actual result: 186
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console