在 Bootstrap 4 中為元素新增底部圓角


如果要為元素新增圓角,則使用 rounded-bottom 類。

在任何元素上使用,比如 <div> −

<div class="demo rounded-bottom"></div>

上面,我們已經為 class 設定了 demo,對於我們的 div,它是一個矩形。

以下是我們的演示 CSS 類 -

<style>
.demo {
  width: 110px;
  height: 150px;
  background-color: blue;
}
</style>

你可以嘗試執行以下程式碼,為元素新增底部圓角 −

示例

即時演示

<!DOCTYPE html>
<html>
  <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: 110px;
    height: 150px;
    background-color: blue;
   }
   </style>
   </head>
<body>
  <div class="container">
    <h2>Rectangle</h2>
    <p>We have a rectangles with rounded corners (bottom):</p>
    <div class="demo rounded-bottom"></div>
  </div>
</body>
</html>

更新於: 15-6-2020

136 次瀏覽

開啟你的 職業生涯

完成課程並獲得認證

開始
廣告
© . All rights reserved.