设置 Bootstrap 按钮的活动状态


要设置 Bootstrap 按钮的活动状态,请使用 .active 类。

按钮将显示为按下状态,如以下代码所示

示例

实时演示

<!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>
      <p>The following are some buttons:</p>
      <button type = "button" class = "btn btn-default btn-lg ">
         Default Button
      </button>
      <button type = "button" class = "btn btn-default btn-lg active">
         Active Button
      </button>
   </body>
</html>

更新时间:2020年6月12日

2K+ 浏览

开始你的职业生涯

完成课程,获得认证

立即开始
广告
© . All rights reserved.