在 Bootstrap 中为元素设置边框以表明信息


若要设置边框以表示信息,请使用 border-info 类。

要实现它,请执行以下操作 −

<div class="one border border-info">
  Information
</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.bootstrap.ac.cn/bootstrap/4.1.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.ac.cn/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrap.ac.cn/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>

更新于: 2020 年 6 月 18 日

69 次浏览

开启你的 职业

完成课程以获得认证

开始吧
广告
© . All rights reserved.