Open In App

Primer CSS Header-Item

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 Header is used to make a header with vertically aligned items and horizontal spacing. Primer CSS Header-Item is used to create the header item using the Header-item class. In this article, we will discuss the Primer CSS Header-Item.



Primer CSS Header-Item Class:

Syntax:



<div class="Header">
  <div class="Header-item">
     ...
  </div>
</div>

Example 1: The following code demonstrates the Primer CSS Header-Item with some items.




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Header-Item </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 Header-Item </h3>
    </div> <br> <br>
  
    <div class="Header">
        <div class="Header-item">
            GFG Item 1
        </div>
        <div class="Header-item">
            GFG Item 2
        </div>
        <div class="Header-item">
            GFG Item 3
        </div>
        <div class="Header-item">
            GFG Item 4
        </div>
    </div>
</body>
  
</html>

Output:

Primer CSS Header-Item with some items

Example 2: The following code demonstrates the Primer CSS Header-Item with some items and a search box.




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Header-Item </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 Header-Item </h3>
    </div> <br> <br>
  
    <div class="Header">
        <div class="Header-item">
            GFG Item 1
        </div>
        <div class="Header-item">
            GFG Item 2
        </div>
        <div class="Header-item Header-item--full">
            GFG Item 3
        </div>
        <div class="Header-item">
            <input class="form-control Header-input" 
                   type="text" />
        </div>
        <div class="Header-item">
            Search
        </div>
    </div>
</body>
  
</html>

Output:

Primer CSS Header-Item with some items and a search box

Reference: https://primer.style/css/components/header#header-item


Article Tags :