Bootstrap 4 .round-top类

Bootstrap 4 .rounded-top class

在Bootstarp 4中使用rounded-top类可为元素设置顶部圆角。

使用该类,我使用相同的类设置了两个矩形:

1
 

还为div设置了一个新类来对其进行样式设置,

1
2
3
4
5
6
7
8
<style>
.new {
 width: 60px;
 height: 60px;
 background-color: #26CF12;
 margin: 20px;
}
</style>

您可以尝试运行以下代码来实现Rounded-top类:

现场演示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html lang="en">
 <head>
 Bootstrap Example
 <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 src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js">
 <style>
 .new {
  width: 60px;
  height: 60px;
  background-color: #26CF12;
  margin: 20px;
 }
 </style>
</head>
<body>
 
  <p>
Rounded Corner
</p>
  <p>
We have two rectangles with top rounded corner:
</p>
 
 
 
</body>
</html>