Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More about grids in CSS3
#1
Description:

CSS Grid is a powerful layout system that allows you to create complex two-dimensional grid-based layouts. It enables you to define rows and columns and place items within the grid, providing precise control over the layout of your web pages.

Example:

<!DOCTYPE html>
<html>
<head>
  <title>CSS Grid Example</title>
  <style>
    /* Create a 3x3 grid layout */
    .grid-container {
      display: grid;
      grid-template-columns: repeat(3, 100px);
      grid-template-rows: repeat(3, 100px);
      grid-gap: 10px;
    }
    .grid-item {
      background-color: lightblue;
      padding: 10px;
      text-align: center;
    }
  </style>
</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 class="grid-item">7</div>
    <div class="grid-item">8</div>
    <div class="grid-item">9</div>
  </div>
</body>
</html>
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)