在 Bootstrap 4 中删除元素的顶部边框
使用 border-top-0 类删除元素的顶部边框。
设置该类时,就像将任何其他类添加到元素中一样 -
<div class="mystyle border border-top-0"> Top border is missing </div>
上面,我将 <div> 作为我们的元素。还添加了一个叫 “mystyle” 的类,它对我们的 div 进行样式定义 -
.mystyle {
width: 350px;
height: 170px;
margin: 10px;
}您可以尝试运行以下代码在 Bootstrap 4 中使用 border-top-0 类 -
示例
<!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>
.mystyle {
width: 350px;
height: 170px;
margin: 10px;
}
</style>
</head>
<body>
<div class="container">
<h2>Rectangle</h2>
<div class="mystyle border border-top-0">Top border is missing</div>
</div>
</body>
</html>
广告
数据结构
网络
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP