在Bootstrap 4中使用border-0类从Bootstrap 4中的元素删除所有边框-
<div class="mystyle border no-border"> no border </div>
上面,我们有div类到无边界类,这使我们可以从元素中删除边框。
让我们看一个在Bootstrap中实现border-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.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script> <style> .mystyle { width: 120px; height: 100px; margin: 10px; background: maroon; } </style> </head> <body> <div class="container"> <h4>Rectangle</h4> <div class="mystyle border no-border">no border</div> </div> </body> </html>