BootStrap 4 .rounded-circle 類


要使用 Bootstrap 建立圓形圓,請使用 rounded-circle 類。

在 <div> 中新增 rounded-circle 類

<div class="test rounded-circle">
</div>

上面,我們還有一個測試類,它是一個 CSS 類,用於設定圓的樣式 −

.test {
  width: 270px;
  height: 320px;
  background-color: yellow;
}

您可以嘗試執行以下程式碼在 Bootstrap 4 中實現 rounded-circle 類 −

示例

現場演示

<!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>
    .test {
      width: 350px;
      height: 320px;
      background-color: yellow;
    }
   </style>
  </head>
<body>
  <div class="container">
    <h2>Circle</h2>
    <p>We have a circle below:</p>
    <div class="test rounded-circle"></div>
  </div>
</body>
</html>

更新於:15-6-2020

8K+ 瀏覽

開啟您的職業生涯

透過完成課程獲得認證

入門
廣告