Skip to content

Instantly share code, notes, and snippets.

@bittu
Created November 21, 2019 17:31
Show Gist options
  • Save bittu/d6efd5d88d63aab021530f8bcec1cda1 to your computer and use it in GitHub Desktop.
Save bittu/d6efd5d88d63aab021530f8bcec1cda1 to your computer and use it in GitHub Desktop.
flexbox center if only one child item else space between child items
.flexbox {
display: flex;
justify-content: space-between;
& > :only-child {
margin-left: auto;
margin-right: auto;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment