JS Bin flex-direction // source https://jsbin.com/bohateb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="flex-direction"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.container{ | |
display: flex; | |
} | |
.one{ | |
/* default */ | |
flex-direction: row; | |
} | |
.two{ | |
flex-direction: row-reverse; | |
} | |
.three{ | |
flex-direction: column; | |
} | |
.four{ | |
flex-direction: column-reverse; | |
} | |
/* basic styling */ | |
.container{ | |
border: 4px solid #61585E; | |
margin-bottom: 10px; | |
} | |
.container > *{ | |
background-color: #EA3556; | |
padding: 5px; | |
color: white; | |
width: 100px; | |
height: 60px; | |
} | |
.container > *:nth-child(even){ | |
background-color: #49AEC0; | |
} | |
</style> | |
</head> | |
<body> | |
<!-- BEGIN LESSON CODE --> | |
<div class="container one"> | |
<div>1</div> | |
<div>2</div> | |
<div>3</div> | |
<div>4</div> | |
<div>5</div> | |
</div> | |
<div class="container two"> | |
<div>1</div> | |
<div>2</div> | |
<div>3</div> | |
<div>4</div> | |
<div>5</div> | |
</div> | |
<div class="container three"> | |
<div>1</div> | |
<div>2</div> | |
<div>3</div> | |
<div>4</div> | |
<div>5</div> | |
</div> | |
<div class="container four"> | |
<div>1</div> | |
<div>2</div> | |
<div>3</div> | |
<div>4</div> | |
<div>5</div> | |
</div> | |
<!-- END LESSON CODE --> | |
<script id="jsbin-source-css" type="text/css">.container{ | |
display: flex; | |
} | |
.one{ | |
/* default */ | |
flex-direction: row; | |
} | |
.two{ | |
flex-direction: row-reverse; | |
} | |
.three{ | |
flex-direction: column; | |
} | |
.four{ | |
flex-direction: column-reverse; | |
} | |
/* basic styling */ | |
.container{ | |
border: 4px solid #61585E; | |
margin-bottom: 10px; | |
} | |
.container > *{ | |
background-color: #EA3556; | |
padding: 5px; | |
color: white; | |
width: 100px; | |
height: 60px; | |
} | |
.container > *:nth-child(even){ | |
background-color: #49AEC0; | |
}</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container{ | |
display: flex; | |
} | |
.one{ | |
/* default */ | |
flex-direction: row; | |
} | |
.two{ | |
flex-direction: row-reverse; | |
} | |
.three{ | |
flex-direction: column; | |
} | |
.four{ | |
flex-direction: column-reverse; | |
} | |
/* basic styling */ | |
.container{ | |
border: 4px solid #61585E; | |
margin-bottom: 10px; | |
} | |
.container > *{ | |
background-color: #EA3556; | |
padding: 5px; | |
color: white; | |
width: 100px; | |
height: 60px; | |
} | |
.container > *:nth-child(even){ | |
background-color: #49AEC0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
row (default): left to right in ltr; right to left in rtl
row-reverse: right to left in ltr; left to right in rtl
column: same as row but top to bottom
column-reverse: same as row-reverse but bottom to top