Set a green border to an element in Bootstrap to indicate success

To set green border, use the border-success class in Bootstrap 4.

The below element will have green border since we have set the class of the <div> as border-success class −

<div class="mystyle border border-success">
  Green border

You can try to run the following code to set green border to an element indicating success −


Live Demo

<!DOCTYPE html>
    <title>Bootstrap Example</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="">
    <script src=""></script>
    <script src=""></script>
     .mystyle {
       width: 150px;
       height: 150px;
       margin: 10px;

<div class="container">
  <div class="mystyle border border-success">Green border</div>