Add a blue background color to an element to set key stuff with Bootstrap

To set key stuff on an element, use the .bg-primary class in Bootstrap.

You can try to run the following code to implement .bg-primary class that is blue in color −


Live Demo

<!DOCTYPE html>
      <title>Bootstrap Example</title>
      <link rel = "stylesheet" href = "">
      <script src = ""></script>
      <script src = ""></script>
      <div class = "container">
      <div class = "w-50 bg-danger">Danger</div>
      <div class = "bg-primary">Key text!</div>