Skip to content

Instantly share code, notes, and snippets.

@aozora
Created January 10, 2018 13:27
Show Gist options
  • Save aozora/77f598f6bc99930a6d76aa23930c3237 to your computer and use it in GitHub Desktop.
Save aozora/77f598f6bc99930a6d76aa23930c3237 to your computer and use it in GitHub Desktop.
HTML:
<div class="box-container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
<div class="box">Box 4</div>
</div>
CSS:
.box-container {
}
.box {
width: 100px;
height: 100px;
background-color: #ddd;
color: #000;
line-height: 100px;
}
@aozora
Copy link
Author

aozora commented Jan 10, 2018

Solution:

.box-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment