在Bootstrap中将bg-warning类与card类一起使用,以对Bootstrap卡设置警告操作。
设置警告消息,例如-
Do not cross! High Voltage!
使用以下代码来设置Bootstrap卡的样式-
<div class="card bg-warning"> <div class="card-body">You are trespassing on private property!</div> </div>
您可以尝试运行以下代码以使用bg-warning类对Bootstrap卡进行样式设置-
<!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> </head> <body> <div class="container"> <h3>Warning</h3> <div class="card bg-warning"> <div class="card-body">You are trespassing on private property!</div> </div> </div> </body> </html>