Open In App

Primer CSS Grid Offset Columns

Improve
Improve
Like Article
Like
Save
Share
Report

Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by Object-Oriented CSS principles, functional CSS, and BEM architecture. It is highly reusable and flexible. It is created with GitHub’s design system.

Primer CSS Grid Offset Columns are used to push the div to X columns using the offset classes. We can offset our element to any number of columns. In this article, we will discuss Primer CSS Grid Offset Columns.

Primer CSS Grid Offset Columns Classes:

  • offset-*: The classes vary from 0 to 12 to offset the columns.

Syntax:

<div class="clearfix">
  <div class="offset-* col-3 border p-3">
       ...
  </div>
</div>

Example 1: The following example demonstrates the Primer CSS Grid Offset Columns.

HTML




<!DOCTYPE html>
<html>
      
<head>
    <title> Primer CSS Grid Offset Columns </title>
    <link rel="stylesheet" 
          href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css"/>
</head>
  
<body>
    <div class="text-center">
        <h1 class="color-fg-success"> GeeksforGeeks </h1>
        <h3> Primer CSS Grid Offset Columns </h3> <br>
          
        <div class="clearfix">
            <div class="offset-1 col-2 border p-2">
                GeeksforGeeks1
            </div>
            <div class="offset-3 col-2 border p-2">
                GeeksforGeeks2
            </div>
        </div>
    </div>
</body>
  
</html>


Output:

Primer CSS Grid Offset Columns

Example 2: The following example demonstrates the Primer CSS Grid Offset Columns.

HTML




<!DOCTYPE html>
<html>
      
<head>
    <title> Primer CSS Grid Offset Columns </title>
    <link rel="stylesheet" 
          href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css"/>
</head>
  
<body>
    <div class="text-center">
        <h1 class="color-fg-success"> GeeksforGeeks </h1>
        <h3> Primer CSS Grid Offset Columns </h3> <br>
          
        <div class="clearfix">
            <div class="offset-1 col-2 border p-2">
                GeeksforGeeks1
            </div>
            <div class="offset-3 col-2 border p-2">
                GeeksforGeeks2
            </div>
            <div class="offset-6 col-2 border p-2">
                GeeksforGeeks3
            </div>
            <div class="offset-5 col-2 border p-2">
                GeeksforGeeks4
            </div>
        </div>
    </div>
</body>
  
</html>


Output:

Primer CSS Grid Offset Columns

Reference: https://primer.style/css/utilities/grid#offset-columns



Last Updated : 25 Apr, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads