在任何面板中包括列表组。通过将类.panel添加到<div>元素来创建面板。另外,将.panel-default类添加到此元素。现在,在此面板中包括您的列表组。
您可以尝试运行以下代码来设置具有列表组的面板-
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <div class = "panel panel-default"> <div class = "panel-heading">Panel heading</div> <div class = "panel-body"> <p>The following is a list of topics in Java.</p> </div> <ul class = "list-group"> <li class = "list-group-item">Java Interfaces</li> <li class = "list-group-item">Java Packages</li> <li class = "list-group-item">File Handling in Java</li> </ul> </div> </body> </html>