<html>
<head>
<meta name="description" content="Flexbox Cheatsheet">
<title>Flexbox Cheatsheet</title>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Flexbox Cheatsheet</h1>
<h3>flex-direction</h3>
<div style="display: flex; ">
<div>flex-direction:</div>
<div>row (default)</div>
</div>
<div style="display: flex; flex-direction: row-reverse;">
<div>row-reverse</div>
<div>flex-direction:</div>
</div>
<div style="display: flex; flex-direction:column; height: 150px;">
<div>flex-direction:</div>
<div>column</div>
</div>
<div style="display: flex; flex-direction:column-reverse; height: 150px;">
<div>column-reverse</div>
<div>flex-direction:</div>
</div>
<h3>flex</h3>
<div style="display: flex; ">
<div>normal div</div>
<div style="flex: 1;">flex: 1;</div>
<div>normal div</div>
</div>
<div style="display: flex;">
<div style="flex: 3;">flex: 3;</div>
<div style="flex: 1;">flex: 1;</div>
<div style="flex: 2;">flex: 2;</div>
</div>
<h3>align-items</h3>
<div style="display: flex; align-items: scretch;">
<div>align-items: scretch (default)</div>
</div>
<div style="display: flex; align-items: flex-start;">
<div>align-items: flex-start</div>
</div>
<div style="display: flex; align-items: center;">
<div>align-items: center</div>
</div>
<div style="display: flex; align-items: flex-end;">
<div>align-items: flex-end</div>
</div>
<h3>justify-content</h3>
<div style="display: flex; justify-content: flex-start;">
<div>justify-content: flex-start (default)</div>
</div>
<div style="display: flex; justify-content: center;">
<div>justify-content: center</div>
</div>
<div style="display: flex; justify-content: flex-end;">
<div>justify-content: flex-end</div>
</div>
<div style="display: flex; justify-content: space-around;">
<div>justify-content: <br>space-around;</div>
<div>justify-content: <br>space-around;</div>
</div>
<div style="display: flex; justify-content: space-between;">
<div>justify-content: <br>space-between;</div>
<div>justify-content: <br>space-between;</div>
</div>
<h3>align-self</h3>
<div style="display: flex; height: 150px;">
<div style="flex: 1; align-self: flex-start;">flex-start</div>
<div style="flex: 1; align-self: center;">center</div>
<div style="flex: 1; align-self: flex-end;">flex-end</div>
<div style="flex: 1; align-self: stretch">stretch<br>(default)</div>
</div>
<h3>flex-wrap</h3>
<div style="display: flex; flex-wrap: wrap; width:150px; height:70px">
<div>horizontal</div>
<div>lay</div>
<div>out</div>
<div>wrap</div>
</div>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |