Flexbox Grid

In this example below you will see how to do a Flexbox Grid with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by vladimirs, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright vladimirs ©
  • HTML
  • CSS
  • JavaScript
    <div class="parent">
  <div class="child">content</div>
  <div class="child">content</div>
  <div class="child">content</div>
  <div class="child">content</div>
  <div class="child">content</div>
  <div class="child">content</div>
</div>

/*Downloaded from https://www.codeseek.co/vladimirs/flexbox-grid-NxvpjJ */
    body {
  margin: 0;
}

* {
  box-sizing: border-box;
}

.parent {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

.child {
  flex: 1 0 25%;
  min-width: 200px;
  margin: 0 0.5rem 1rem 0;
  padding: 0.5rem;
  background: #222;
  color: #fff;
}



/*Downloaded from https://www.codeseek.co/vladimirs/flexbox-grid-NxvpjJ */
    

Comments