在 Bootstrap 中为元素添加右圆角
bootstrapweb developmentcss framework更新于 2024/1/22 23:40:17
使用 Bootstrap 4 中的 rounded-right 类为元素添加右圆角。
只需将 rounded-right 类设置为元素,例如 − 下方的 <div>
<div class="one rounded-right></div>
这里,还设置了另一个类 “one” 来为 <div> 元素添加样式 −
<style>
.one {
width: 250px;
height: 120px;
background-color: #265C80;
margin: 20px;
}
</style>
让我们看一个为矩形设置右圆角的示例 −
示例
<!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>
.one {
width: 250px;
height: 120px;
background-color: #265C80;
margin: 20px;
}
</style>
</head>
<body>
<div class="container">
<h2>Rounded Corner</h2>
<p>We have a rectangle with right rounded corner:</p>
<div class="one rounded-right"></div>
</div>
</body>
</html>

