在 Bootstrap 中为元素设置边框以指示信息

bootstrapweb developmentcss framework更新于 2024/2/2 23:08:17

要设置指示信息的边框,请使用 border-info 类。

实现 −

<div class="one border border-info">
  信息
</div>

让我们看一个实现 border-info 类的示例 −

示例

<!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>
    .one {
      width: 200px;
      height: 240px;
      margin: 40px;
    }
    </style>
  </head>
<body>
  <div class="container">
    <p>Rectangle with a border indicating information:</p>
    <div class="one border border-info">Information</div>
  </div>
</body>
</html>

相关文章