要设置绿色边框,请使用Bootstrap 4中的border-success类。
以下元素将具有绿色边框,因为我们已将<div>的类设置为border-success类-
<div class="mystyle border border-success"> Green border </div>
您可以尝试运行以下代码以将绿色边框设置为表示成功的元素-
<!DOCTYPE html> <html> <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: 150px; height: 150px; margin: 10px; } </style> </head> <body> <div class="container"> <h2>Rectangle</h2> <div class="mystyle border border-success">Green border</div> </div> </body> </html>