设置带有标题的 Bootstrap 面板
按照以下步骤在 Bootstrap 中设置带标题的面板:
- 使用 .panel-heading 类向面板添加一个标题容器。
- 使用带有 .panel-title 类的任何 <h1>-<h6> 添加预设标题。
你可以尝试运行以下代码,获取 Bootstrap 中带有标题的面板:
例如
<!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"> Tutorials </div> <div class = "panel-body"> Learn for free </div> </div> <div class = "panel panel-default"> <div class = "panel-heading"> <h3 class = "panel-title"> Quiz </h3> </div> <div class = "panel-body"> Attempt these quizzes </div> </div> </body> </html>
广告