VOOZH about

URL: https://www.geeksforgeeks.org/css/primer-css-typography-heading-utilities/

⇱ Primer CSS Typography Heading Utilities - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Primer CSS Typography Heading Utilities

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.

In this article, we will learn about Typography Heading Utilities. Just like in HTML, we use <h1> to <h6> tags to create headings, we have heading utilities in Primer CSS to create headings. In Primer CSS, we use .h1 – .h6 to change an element's font size and weight to match our heading styles.

Class:

  • h*: The classes vary from h1 to h6 depending on the required font size.

Syntax:

<p class=" h* "> 
 Content
</p>

* can be substituted with numbers from 1 to 6 based upon need.

Example 1: In this example, we will learn about classes h1, h2, and h3.

Output:

πŸ‘ Image
 

Example 2: In this example, we will learn about classes h4, h5, and h6.

Output:

πŸ‘ Image
 

Reference: https://primer.style/product/css-utilities/#heading-utilities

Comment