Bootstrap 4 .border-primary class

Add a blue border to an element in Bootstrap 4 using the border-primary class as shown below:

Set the class as −

<div class="demo border border-primary">
  Blue Border

You can try to run the following code to implement the border-primary class −


Live Demo

<!DOCTYPE html>
<html lang="en">
    <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>
    .demo {
      width: 250px;
      height: 170px;
      margin: 10px;
  <div class="container">
    <h3>Demo Heading</h3>
    <div class="demo border border-primary">Blue Border</div>

Updated on: 18-Jun-2020


Kickstart Your Career

Get certified by completing the course

Get Started