Open In App

Primer CSS Boxes with Flash Alerts

Improve
Improve
Like Article
Like
Save
Share
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 Box is used to display the content in the simple rounded corner box. Primer CSS Boxes with Flash Alerts are used to put the flash alerts below the box header and above the box body. We can have different colors of flash alerts and can be used with icons and buttons. In this article, we will discuss Primer CSS Boxes with Flash Alerts.

Primer CSS Boxes with Flash Alerts Class:

  • flash-full: This class is used to create the flash alert.

Syntax:

<div class="Box">
  <div class="flash flash-full">
     ...
  </div>
</div>

Example 1: The following code demonstrates the Primer CSS Boxes with Flash Alerts.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Boxes with Flash Alerts </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 Boxes with Flash Alerts </h3>
    </div> <br> <br>
  
    <div class="Box">
        <div class="Box-header">
            GFG header
        </div>
        <div class="flash flash-full">
            <svg class="octicon" viewBox="0 0 14 16" 
                 width="18" height="20">
                <path d="M13.78 4.22a.75.75 0 010 1.06l-7.25 
                    7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 
                    011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">
                </path>
            </svg>
            <span> GeeksforGeeks Flash alert with Icon </span>
        </div>
        <div class="Box-body">
            GFG Body
        </div>
    </div>
</body>
  
</html>


Output:

Primer CSS Boxes with Flash Alerts.

Example 2: The following code demonstrates the Primer CSS Boxes with Flash Alerts with different colors of flash alerts.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title> Primer CSS Boxes with Flash Alerts </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 Boxes with Flash Alerts </h3>
    </div> <br> <br>
  
    <div class="Box">
        <div class="Box-header">
            GFG header
        </div>
        <div class="flash flash-full flash-warn">
            <button href="#" class="Box-btn-octicon btn-octicon">
                <svg class="octicon" viewBox="0 0 14 16" 
                     width="18" height="20" >
                    <path d="M13.78 4.22a.75.75 0 010 1.06l-7.25 
                        7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 
                        011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">
                    </path>
                </svg>
            </button>
            <span> GeeksforGeeks Warning Flash alert </span>
        </div>
        
        <div class="flash flash-full flash-success">
            <svg class="octicon" viewBox="0 0 14 16" 
                 width="18" height="20">
                <path d="M13.78 4.22a.75.75 0 010 1.06l-7.25 
                    7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 
                    011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">
                </path>
            </svg>
            <span> GeeksforGeeks Success Flash alert </span>
        </div>
        
        <div class="flash flash-full flash-error">
            <svg class="octicon" viewBox="0 0 14 16" 
                 width="18" height="20">
                <path d="M13.78 4.22a.75.75 0 010 1.06l-7.25 
                    7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 
                    011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z">
                </path>
            </svg>
            <span> GeeksforGeeks Error Flash alert </span>
        </div>
        <div class="Box-body">
            GFG Body
        </div>
    </div>
</body>
  
</html>


Output:

Primer CSS Boxes with Flash Alerts.

Reference: https://primer.style/css/components/box#boxes-with-flash-alerts



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