Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


                <div class="forms">
  <div class="controls">
    <label for="direction">direction:</label>
    <select id="direction">
      <option value="ltr">ltr</option>
      <option value="rtl">rtl</option>
  <div class="controls">
    <label for="writingmode">writing-mode:</label>
    <select id="writingmode">
      <option value="horizontal-tb">horizontal-tb</option>
      <option value="vertical-lr">vertical-lr</option>
      <option value="vertical-rl">vertical-rl</option>
      <option value="sideways-rl">sideways-rl</option>
      <option value="sideways-lr">sideways-lr</option>

  <div class="controls">
    <label for="flexFlow">flex-flow:</label>
    <select id="flexFlow">
      <option value="row">row</option>
      <option value="row-reverse">row-reverse</option>
      <option value="column">column</option>
      <option value="column-reverse">column-reverse</option>
      <option value="nowrap">nowrap</option>
      <option value="wrap">wrap</option>
      <option value="wrap-reverse">wrap-reverse</option>
      <option value="row nowrap">row nowrap</option>
      <option value="row wrap">row wrap</option>
      <option value="row wrap-reverse">row wrap-reverse</option>
      <option value="row-reverse nowrap">row-reverse nowrap</option>
      <option value="row-reverse wrap">row-reverse wrap</option>
      <option value="row-reverse wrap-reverse">row-reverse wrap-reverse</option>
      <option value="column nowrap">column nowrap</option>
      <option value="column wrap">column wrap</option>
      <option value="column wrap-reverse">column wrap-reverse</option>
      <option value="column-reverse nowrap">column-reverse nowrap</option>
      <option value="column-reverse wrap">column-reverse wrap</option>
      <option value="column-reverse wrap-reverse">column-reverse wrap-reverse</option>
  <div class="controls">
    <label for="alignItems">align-items:</label>
    <select id="alignItems">
      <option value="stretch">stretch</option>
      <option value="flex-start">flex-start</option>
      <option value="flex-end">flex-end</option>
      <option value="center">center</option>
      <option value="baseline">baseline</option>
      <option value="first baseline">first baseline</option>
      <option value="last baseline">last baseline</option>
      <option value="start">start</option>
      <option value="end">end</option>
      <option value="self-start">self-start</option>
      <option value="self-end">self-end</option>

<div id="container">
  <div class="flex__container">
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>
    <div class="flex__item"></div>


                @import url("");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;

body {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 10vh;
  background-color: #291642;
  font-family: "Gochi Hand", sans-serif;
  font-size: 130%;
  letter-spacing: 0.1rem;
  color: #fff;
  display: flex;
  align-items: center;
  flex-direction: column;

.forms {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3vh;
.controls {
  background-color: rgba(0,0,0,.1);
  padding: 10px;
  border-radius: .5em;
  border: 1px solid rgba(0,0,0,.2);
  margin: 0 10px;

.controls select {
  font-size: .9em;

:root {
  --writingMode: horizontal-tb;
  --direction: ltr;
  --flexFlow: row nowrap;
  --alignItems: stretch;

#container {
  writing-mode: var(--writingMode);
  direction: var(--direction);
  margin-top: 10vh;

.flex__container {
  display: flex;
  align-items: var(--alignItems);
  inline-size: 80vh;
  block-size: 20vh;
  border: 1px dashed #E91E63;
  border-color: #FFEB3B #FF5722 #fff #00BCD4; 
  position: relative;
  counter-reset: listCounter;

.flex__item {
  display: flex;
  justify-content: center;
  align-items: center;
/*   inline-size: 10vh;
  block-size: 10vh; */
  counter-increment: listCounter;

.flex__item::before {
  content:  "[" counter(listCounter) "]";
  font-size: 2rem;
  background: rgba(0,0,0,.65);
  padding: 4px;
  border-radius: 4px;

.flex__item:nth-child(1) {
  background-color: #f36;

.flex__item:nth-child(2) {
  background-color: #CDDC39;

.flex__item:nth-child(2)::before {
  font-size: 4rem;

.flex__item:nth-child(3) {
  background-color: #2196F3;

.flex__item:nth-child(4) {
  background-color: #FF5722;

.flex__item:nth-child(4)::before {
  font-size: 1rem;



                const writingMode = document.getElementById("writingmode");
const direction = document.getElementById("direction");
const flexFlow = document.getElementById("flexFlow");
const justifyContent = document.getElementById("alignItems");

const documentElement = document.documentElement;

writingMode.addEventListener("change", function (evt) {"--writingMode",;

direction.addEventListener("change", function (evt) {"--direction",;

flexFlow.addEventListener("change", function (evt) {"--flexFlow",;

alignItems.addEventListener("change", function (evt) {"--alignItems",;