Tutorialspoint examples

Learn java tutorial with examples for beginners online

Bootstrap Panels with Contextual Classes


Panel refers to a bordered box with some padding around its content.

Bootstrap provides the .panel class to create the panel. The .panel-body class is used for the content inside the panel.

Bootstrap provides the .panel-default, .panel-primary, .panel-success, .panel-info, .panel-warning or .panel-danger classes to color the panel.

Bootstrap Panels with Contextual Classes Example:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Panels with Contextual Classes Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container">
  <h2>Bootstrap Panels with Contextual Classes Example</h2>
  <div class="panel-group">
    <div class="panel panel-default">
      <div class="panel-heading">Panel with panel-default class</div>
      <div class="panel-body">Bootstrap Panel Content</div>
    </div>
 
    <div class="panel panel-primary">
      <div class="panel-heading">Bootstrap Panel with panel-primary class</div>
      <div class="panel-body">Bootstrap Panel Content</div>
    </div>
 
    <div class="panel panel-success">
      <div class="panel-heading">Bootstrap Panel with panel-success class</div>
      <div class="panel-body">Bootstrap Panel Content</div>
    </div>
 
    <div class="panel panel-info">
      <div class="panel-heading">Bootstrap Panel with panel-info class</div>
      <div class="panel-body">Bootstrap Panel Content</div>
    </div>
 
    <div class="panel panel-warning">
      <div class="panel-heading">Bootstrap Panel with panel-warning class</div>
      <div class="panel-body">Bootstrap Panel Content</div>
    </div>
 
    <div class="panel panel-danger">
      <div class="panel-heading">Bootstrap Panel with panel-danger class</div>
      <div class="panel-body">Bootstrap Panel Content</div>
    </div>
  </div>
</div>
 
</body>
</html>

Try it:

Bootstrap Panels with Contextual Classes Example on jsbin.com

Copyright © 2018 Tutorialspoint examples DMCA.com Protection Status