Simplest flexbox example

.container {
  display: flex;
  justify-content: space-around;
}

Nicely spaces whatever elements are inside it. Other useful values for justify-content are center, space-between, and space-evenly. Complete details on flexbox here.

January 28, 2019 CSS


Written by Alesh Houdek, a web developer in Colorado. This is mostly code snippets and ideas I might want to reuse. HomepageTwitter