<div class="forms">
  <div class="controls">
    <label for="display">display:</label>
    <select id="display">
      <option value="flex">flex</option>
      <option value="block flex">block flex</option>
      <option value="inline-flex">inline-flex</option>
      <option value="inline flex">inline flex</option>
    </select>
  </div>
</div>

<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>
  </div>
</div>
@import url("https://fonts.googleapis.com/css?family=Gochi+Hand");

* {
  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 {
  --display: flex;
}

#container {
  margin-top: 10vh;
  width: 100%;
}

.flex__container {
  display: var(--display);
  
  border: 2px solid #E91E63;
  border-radius: 6px;
  box-shadow: 0 0 2px 3px #ffeb3b7a, inset 0 0 2px 3px #03a9f48a;
  padding: 2vh;
  
  position: relative;
  counter-reset: listCounter;
}

.flex__item {
  display: flex;
  justify-content: center;
  align-items: center;
  inline-size: 10vh;
  block-size: 10vh;
  margin: 2vh;
  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(3) {
  background-color: #2196F3;
}

.flex__item:nth-child(4) {
  background-color: #FF5722;
}
View Compiled
const display = document.getElementById("display");
const documentElement = document.documentElement;

display.addEventListener("change", function (evt) {
  documentElement.style.setProperty("--display", evt.target.value);
});
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.