使用輪廓為紅色的 Bootstrap 4 按鈕指示危險


在 Bootstrap 4 中使用 btn-outline-danger 類,使用紅色輪廓指示危險。

以下是設定一個用紅色輪廓指示危險的按鈕的示例 −

<button type="button" class="btn btn-outline-danger">
  Danger
</button>

該類使用 Bootstrap 中的 btn 和 btn-outline-danger 類新增 −

class="btn btn-outline-danger”

我們來看一個實現 btn-outline-danger 類的示例 −

示例

線上演示

<!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/4.1.0/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.0/js/bootstrap.min.js"></script>
  </head>
<body>
  <h2>Animals</h2>
  <p>Animals are in danger. To know what, you need to click below:</p>
  <button type="button" class="btn btn-outline-danger">Danger</button>

</body>
</html>

更新於: 17-6-2020

104 瀏覽量

開啟您的職業生涯

完成課程認證

開始學習
廣告
© . All rights reserved.