InterviewSolution
Saved Bookmarks
| 1. |
Define Bootstrap Panels |
|
Answer» The Bootstrap Panel COMPONENT allow you to add a bordered container with some padding AROUND the CONTENT inside it. The .panel CLASS is used in Bootstrap to create a panel. However, you need to include another class for content i.e. panel-body. Let us see an example to create a panel: <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap 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>Panels in Bootstrap</h2> <div class="panel panel-default"> <div class="panel-body">This is our Panel</div> </div> </div> </body> </html>The following output DISPLAYS Panels in Bootstrap: You can also add a separate heading to a panel using the .panel-heading class. Let us see an example of headings in Panel: <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap 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>Panels in Bootstrap</h2> <div class="panel panel-default"> <div class="panel-heading">Panel Heading</div> <div class="panel-body">This is our Panel</div> </div> </div> </body> </html>The following is the output: |
|