使用 Bootstrap 为元素增加绿色背景色可设定为肯定操作


在 Bootstrap 中使用 class .btn-success 可为元素设定肯定操作。你可以尝试运行以下代码以实现 class .btn-success −

示例

实况演示

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/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/4.1.1/js/bootstrap.min.js"></script>
   </head>
   <body>
      <p>The following are FMCG companies:</p>
      <div class = "btn-default">
         <button type = "button" class = "btn btn-primary">ITC Limited</button>
         <button type = "button" class = "btn btn-primary">Nestle</button>
         <button type = "button" class = "btn btn-primary">Britannia Industries Limited</button>
      </div>
      <p>Click below if the above list is correct:</p>
      <button type = "button" class = "btn btn-success">Success</button>
   </body>
</html>

更新于:12-Jun-2020

129 次浏览

开启您的 职业生涯

完成课程以取得认证

开始
广告