POC quincunx layout

In this example below you will see how to do a POC quincunx layout with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by tibomahe, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright tibomahe ©

Technologies

  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>POC quincunx layout</title>
  
  
  <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>

      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="container">
  
<div class="row">
  <div class="col-md-8">
    <article class="art1"></article>
  </div>
  <div class="col-md-4">
    <article class="art2"></article>
  </div>
</div>
  
<div class="row">
  <div class="col-md-4">
    <article class="art3"></article>
  </div>
  <div class="col-md-4">
    <article class="art4"></article>
  </div>
</div>
  
<div class="row">
 <div class="col-md-8 col-md-offset-4">
    <article class="art5"></article>
  </div>
 </div>

</div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/tibomahe/poc-quincunx-layout-VaXGJM */
article {
  background: #666;
  margin-bottom: 15px;
}
@media (min-width: 992px) {
  article {
    margin: 0;
  }
}

.row {
  margin-bottom: 0;
}
@media (min-width: 992px) {
  .row {
    margin-bottom: 30px;
  }
}

.art1,
.art4,
.art5 {
  height: 250px;
  width: 100%;
  padding: 0 15px;
}

.art2,
.art3 {
  height: 250px;
}
@media (min-width: 992px) {
  .art2,
  .art3 {
    height: 530px;
    width: calc(100% - 30px);
    padding: 0 15px;
    position: absolute;
    top: 0;
  }
}

Comments