css-layout-test-2

by Richard Hunter

HTML

<div class="inline-container">
  <button>alpha</button>
  <button>beta</button>
  <div class="inline-container pink">
    <button>alpha</button>
    <button>beta</button>
    <div class="inline-container green">
      <button>alpha</button>
      <button>beta</button>
    </div>
  </div>
  <button>alpha</button>
  <button>beta</button>
</div>

CSS

.inline-container {
  display: flex;
  background: aliceblue;
  
  flex-direction: row;
  justify-content: flex-start;
}

.inline-container.pink {
  background: salmon;
}

.inline-container.green {
   background: forestgreen;
}

button {
  -webkit-appearance: none;
  border: 1px solid red;
  background: white;
  padding: 4px 8px;
  border-radius: 4px;
  margin: 4px;
}