VOOZH about

URL: https://www.geeksforgeeks.org/css/primer-css-grid-centering-a-column/

โ‡ฑ Primer CSS Grid Centering a Column - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Primer CSS Grid Centering a Column

Last Updated : 23 Jul, 2025

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.

The Grid Centering Column centers the columns within the container. We can center the columns using the mx-auto class.

Primer CSS Grid Centering a Column Class:

  • mx-auto: This class is used to center the columns.

Syntax:

<div class="col-4 mx-auto">
 Content
</div>

Example 1: This example demonstrates the implementation of the Primer CSS Grid Centering a Column to center the text.

Output:

๐Ÿ‘ Image
Primer CSS Grid Centering a Column

Example 2: This example demonstrates the implementation of the Primer CSS Grid Centering a Column to center the image.

Output:

๐Ÿ‘ Image
Primer CSS Grid Centering a Column

Reference: https://primer.style/product/css-utilities/#centering-a-column

Comment