Get started with css-layout CDN

BSD licensed

CSS-Layout is a library that simplifies complex CSS layout tasks, providing utilities for grid and flexbox layouts.

Tags:
  • css
  • flexbox
  • layout

Stable version

Copied!

How to start using css-layout CDN


<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css-grid-layout.min.css">
  <script src="https://cdn.cdnhub.io/css-layout/1.1.1/css-layout.min.js"></script>
  <style>
    .grid-container {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-template-rows: repeat(2, 1fr);
      grid-gap: 10px;
      height: 100vh;
    }

    .grid-item {
      grid-column: span 1;
      grid-row: span 1;
      background-color: #f1f1f1;
      text-align: center;
      line-height: 100px;
      font-size: 2em;
    }

    .grid-item:nth-child(1) {
      grid-column: 1 / 2;
      grid-row: 1 / 2;
    }

    .grid-item:nth-child(2) {
      grid-column: 2 / 3;
      grid-row: 1 / 2;
    }

    .grid-item:nth-child(3) {
      grid-column: 1 / 2;
      grid-row: 2 / 3;
    }

    .grid-item:nth-child(4) {
      grid-column: 2 / 3;
      grid-row: 2 / 3;
    }

    .grid-item:nth-child(5) {
      grid-column: 1 / 2;
      grid-row: 3 / 4;
    }

    .grid-item:nth-child(6) {
      grid-column: 2 / 3;
      grid-row: 3 / 4;
    }
  </style>
  <title>Get started with css-layout CDN - cdnhub.io</title>
</head>
<body>
  <div class="grid-container">
    <div class="grid-item">1</div>
    <div class="grid-item">2</div>
    <div class="grid-item">3</div>
    <div class="grid-item">4</div>
    <div class="grid-item">5</div>
    <div class="grid-item">6</div>
  </div>
</body>
</html>
Copied!
Copied!
Copied!

All versions