Bootstrap 4 .border-success类
在Bootstrap中的元素上显示绿色边框,以指示使用border-success类成功。
将边框设置为绿色-
<div class="mystyle border border-success"> Green border </div>
我还在div中添加了“mystyle”类,该类用于设置div的样式,在我的示例中为矩形-
.mystyle { width: 250px; height: 150px; margin: 10px; }
实现边框成功,如下所示-
示例
<!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: 250px; height: 150px; margin: 10px; } </style> </head> <body> <div class="container"> <h2>Shape</h2> <div class="mystyle border border-success">Green border</div> </div> </body> </html>