Open In App

Primer CSS Box Dashed Border

Last Updated : 12 Apr, 2022
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.

In this article, we will discuss Primer CSS Dashed Border. Dashed Border is a series of short lines. It can be obtained by using the class border-dashed in Primer CSS.

Class:

  • border-dashed: It is used to apply a dashed border to a box.

Syntax:

<div class="border border-dashed ">
    Content
</div>

Example 1: In this example, we will write some text, and make a dashed border around it.

HTML




<!DOCTYPE html>
<html>
<head>
    <link href=
"https://unpkg.com/@primer/css@^16.0.0/dist/primer.css" 
          rel="stylesheet" />
</head>
  
<body>
    <div>
        <h1 style="color:green">GeeksforGeeks</h1>
        <h3> Dashed Borders</h3>
    </div>
    <div class="border border-dashed ">
        GeeksforGeeks is a Computer Science Portal 
    </div>
</body>
</html>


Output:

 

Example 2: In this example, we will make a dashed border around a div that includes both text and image.

HTML




<!DOCTYPE html>
<html>
<head>
    <link href=
"https://unpkg.com/@primer/css@^16.0.0/dist/primer.css" 
          rel="stylesheet" />
</head>
  
<body>
    <div>
        <h1 style="color:green">GeeksforGeeks</h1>
        <h3> Dashed Borders</h3>
    </div>
    <div class="border border-dashed ">
        GeeksforGeeks is a Computer Science Portal 
        <br>
        <img src=
             width=100px height=100px>
        </img>
    </div>
</body>
</html>


Output:

 

Reference: https://primer.style/css/components/box#dashed-border



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads