用 Bootstrap 4 按鈕的灰色輪廓設定不太重要的內容


要在 Bootstrap 中設定不太重要的內容,請使用 btn-outline-secondary 類。

輪廓應用於按鈕,並且使用同一個類應用綠色 −

<button type="button" class="btn btn-outline-secondary">
  Tools (Secondary Outline)
</button>

上面,我已經將 btn-outline-secondary 類設定為對任何元素(此處為按鈕)設定的任何普通類。

你可以嘗試執行以下程式碼來了解如何設定灰色輪廓 Bootstrap 按鈕 −

示例

即時演示

<!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>Web Tools</h2>
  <p>The following are the Tools:</p>
  <ul class = "list-group">
    <li class = "list-group-item">JSON Editor</li>
    <li class = "list-group-item">XML Editor</li>
  </ul>
  <p>For more, click below:</p>
  <button type="button" class="btn btn-outline-secondary"> Tools (Secondary Outline)</button>

</body>
</html>

更新於: 16-6 月-2020

61 Views

開始您的 職業

完成課程並獲得認證

開始
廣告
© . All rights reserved.