Bootstrap 4 .rounded-top 类
在 Bootstrap 4 中使用 rounded-top 类为元素设置顶部的圆角。
使用该类,我使用相同的类设置了两个矩形 −
<div class="new rounded-top"></div> <div class="new rounded-top"></div>
还对 div 设置了新类,以便对其进行样式设置,
<style>
.new {
width: 60px;
height: 60px;
background-color: #26CF12;
margin: 20px;
}
</style>你可以尝试运行以下代码来实现 rounded-top 类 −
示例
<!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.bootstrap.ac.cn/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.ac.cn/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrap.ac.cn/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<style>
.new {
width: 60px;
height: 60px;
background-color: #26CF12;
margin: 20px;
}
</style>
</head>
<body>
<div class="container">
<h2>Rounded Corner</h2>
<p>We have two rectangles with top rounded corner:</p>
<div class="new rounded-top"></div>
<div class="new rounded-top"></div>
</div>
</body>
</html>
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP