使用border-primary类为元素设置蓝色边框。
对于蓝色边框,添加类,就像为<div>或任何其他元素添加类一样-
<div class="demo border border-primary"> </div>
让我们看一个设置蓝色边框的示例-
<!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> .demo { width: 350px; height: 170px; margin: 10px; } </style> </head> <body> <div class="container"> <h2>Demo Heading</h2> <div class="demo border border-primary">This rectangle has blue border</div> </div> </body> </html>