在 Bootstrap 中将元素设置为圆形
bootstrapweb developmentcss framework更新于 2024/1/14 16:44:17
要将元素设置为圆形,请使用 Bootstrap 中的 .rounded-circle 类。
实现起来很简单 −
<div class="test rounded-circle></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.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: 300px;
height: 300px;
background-color: orange;
}
</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>

