Bootstrap 4 .border-primary 類


如下所示,使用 border-primary 類在 Bootstrap 4 中為元素新增藍色邊框

將類設定為 −

<div class="demo border border-primary">
  Blue Border
</div>

你可以嘗試執行以下程式碼來實現 border-primary 類 −

示例

真實演示

<!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>
    <style>
    .demo {
      width: 250px;
      height: 170px;
      margin: 10px;
    }
    </style>
  </head>
<body>
  <div class="container">
    <h3>Demo Heading</h3>
    <div class="demo border border-primary">Blue Border</div>
  </div>
</body>
</html>

更新於: 2020 年 6 月 18 日

160 次瀏覽

開啟你的 事業

透過完成本課程獲得認證

開始吧
廣告