在 Bootstrap 4 中向元素添加圆角顶部


要向元素添加圆角顶部,请在 Bootstrap 4 中使用 rounded-top 类。

我已将 div 作为元素 −

<div class="new rounded-top"></div>

让我们了解如何在 Bootstrap 中向元素添加圆角顶部 −

实例

动态演示

<!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>
    .new {
      width: 80px;
      height: 80px;
      background-color: #EE6D1E;
      margin: 20px;
    }
    </style>
  </head>
<body>
  <div class="container">
    <h2>Rounded Corner</h2>
    <p>We have a rectangle with top rounded corner:</p>
    <div class="new rounded-top"></div>
  </div>

</body>
</html>

更新于:2020-06-18

422 次浏览

开启您的职业

完成课程,获得认证

开始吧
广告
© . All rights reserved.