Open In App
Related Articles

Primer CSS Subhead

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
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 Subhead is a container that has a light gray bottom border. We can use Subhead-heading class to create the heading of Subhead. We can use other classes like Subhead-description, Subhead-actions, Subhead–spacious, etc. 

Primer CSS Subhead Classes:

  • Subhead: This class is used to create the subhead.
  • Subhead-heading: This class is used to create the heading of the subhead.
  • Subhead–spacious: This class is used to create the subhead with a top margin.
  • Subhead-description: This class is used to provide a description.
  • Subhead-actions: This class is used to create the subhead with action buttons.
  • Subhead-heading–danger: This class is used to create the danger subhead.

Syntax:

<div class="Subhead">
  <h2 class="Subhead-heading">
      ...
  </h2>
  ...
</div>

Example 1: This example demonstrates the implementation of the Primer CSS Subhead using Subhead, Subhead-heading, and Subhead-description classes.

HTML

<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Subhead </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 Subhead </h3> <br>
  
        <div class="Subhead">
            <h2 class="Subhead-heading">
                GFG Plain Subhead with description 
            </h2>
            <div class="Subhead-description">
                A Computer Science portal for geeks. 
            </div>
        </div>
    </div>
</body>
  
</html>

                    

Output:

Primer CSS Subhead

Example 2: This example demonstrates the implementation of the Primer CSS Subhead using Subhead–spacious, Subhead-actions, and Subhead-heading–danger classes.

HTML

<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Subhead </title>
    <link rel="stylesheet" href=
"https://unpkg.com/@primer/css@^18.0.0/dist/primer.css" /> 
</head>
  
<body class="m-2">
    <div class="text-center">
        <h1 class="color-fg-success"> GeeksforGeeks </h1>
        <h3> Primer CSS Subhead </h3> <br>
  
        <div class="Subhead Subhead--spacious">
            <h2 class="Subhead-heading Subhead-heading--danger">
                GFG Spacious Subhead
            </h2>
            <div class="Subhead-actions">
                <a href="#url" class="btn btn-sm btn-primary"
                    GeeksforGeeks 
                </a>
            </div>
        </div>
    </div>
</body>
  
</html>

                    

Output:

Primer CSS Subhead

Reference: https://primer.style/css/components/subhead



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