Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Primer CSS Grid Column Widths

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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:

  • col-*: This class is used to specify the number of columns the element is taking.
  • float-right: This class is used to float the element right.

Syntax:

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

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

HTML




<!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.

HTML




<!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


My Personal Notes arrow_drop_up
Last Updated : 25 Apr, 2022
Like Article
Save Article
Similar Reads
Related Tutorials