Bootstrap 4 .border-dark 類


要在 Bootstrap 中為元素設定暗色邊框,請使用 border-dark 類。

使用起來很簡單,只需將類名稱用作元素類即可 −

<div class="test border border-dark">
  Dark Border
</div>

上面還可以看到 "test" 類。這對於為元素設定樣式很有用 −

<style>
.test {
  width: 150px;
  height: 150px;
  margin: 35px;
}
</style>

你可以嘗試執行以下程式碼在 Bootstrap 4 中實現 border-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>
    <style>
    .test {
      width: 150px;
      height: 150px;
      margin: 35px;
    }
    </style>
  </head>
<body>

<div class="container">
  <p>Rectangle with dark border:</p>
  <div class="test border border-dark">Dark Border</div>
</div>

</body>
</html>

更新於:17-6-2020

443 人瀏覽

開啟你的 職業 生涯

完成課程以獲得認證

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