灰色的 Bootstrap 4 按鈕邊框


若要為按鈕設定灰色的邊框,請使用 btn-outline-dark 類。

將 btn-outline-dark 類包括在內,就像將任何其他類新增到元素中一樣。此處,我們有按鈕元素,因為我們要為按鈕設定灰色的邊框

<button type="button" class="btn btn-outline-dark">
  Dark gray outline
</button>

讓我們看一個示例,以在 Bootstrap 中實現 btn-outline-dark 類 −

示例

線上演示

<!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>
  <div class="container">
    <h4>Bootstrap 4</h4>
    <p>Learning  btn-outline-dark class usage:</p>
    <button type="button" class="btn btn-outline-dark">Dark gray outline</button>
  </div>
</body>
</html>

更新日期: 16-Jun-2020

262 次瀏覽

開啟您的職業

完成課程以獲得認證

開始吧
廣告
© . All rights reserved.