two column grid

In this example below you will see how to do a two column grid with some HTML / CSS and Javascript

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

Technologies

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

<head>
  <meta charset="UTF-8">
  <title>two column grid</title>
  
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

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

  
</head>

<body>

  <div class='grid'>
  <div class='column'>
    left
  </div>
  <div class='column'>
    <div class='text'>
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, nemo? Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, nemo?
    </div>
  </div>
</div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>

  

</body>

</html>

/*Downloaded from https://www.codeseek.co/phildebrandt/two-column-grid-baNMqa */
body {
  background: #ccc;
  padding: 30px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 1rem;
}

.column {
  background: #fff;
  white-space: nowrap;
}

.text {
  overflow: hidden;
}

Comments