Open In App

Primer CSS Grid Column Widths

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 Column Widths are used to specify the percentage-based columns widths to any block and inline element.



Primer CSS Grid Column Widths Classes:

Syntax:



<div>
  <div class="col-4 float-right">
    ...
  </div>
  <p> .... </p>
</div>

Example 1: The following example demonstrates the Primer CSS Grid Column Widths.




<!DOCTYPE html>
<html>
      
<head>
    <title> Primer CSS Grid Column Widths </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 Column Widths </h3> <br>
          
        <div>
            <div class="col-4 float-right p-1 
                 border-dashed color-fg-success">
              <strong> Floated right </strong>
            </div>
            <p
                A Computer Science portal for geeks. 
                It contains well written, well thought
                and well explained computer science and
                programming articles
            </p>
        </div>
    </div>
</body>
  
</html>

Output:

Primer CSS Grid Column Widths

Example 2: The following example demonstrates the Primer CSS Grid Column Widths using images.




<!DOCTYPE html>
<html>
      
<head>
    <title> Primer CSS Grid Column Widths </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 Column Widths </h3> <br>
          
        <div>
            <div class="col-3 float-right p-1 
                    color-fg-success">
                <img src=
            </div>
  
            <div class="col-4 float-right p-1 
                    color-fg-success">
                <img src=
            </div>
              
            <p
                A Computer Science portal for geeks. 
                It contains well written, well thought
                and well-explained computer science and
                programming articles.
                A Computer Science portal for geeks. 
                It contains well written, well thought
                and well-explained computer science and
                programming articles
            </p>
        </div>
    </div>
</body>
  
</html>

Output:

Primer CSS Grid Column Widths

Reference: https://primer.style/css/utilities/grid#column-widths


Article Tags :