要对Bootstrap中的卡设置积极的操作,请将bg-success类与card类一起使用
采取积极行动并使用“卡片成功成功”-
<div class="card bg-success text-white">
现在使用card-body类添加卡的主体-
<div class="card bg-success text-white"> <div class="card-body">India won by 7 wickets</div> </div>
您可以尝试运行以下代码来实现card-success类-
<!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>Result</h3> <p>Result of the first two matches between India and Australia:</p> <div class="card bg-success text-white"> <div class="card-body">India won by 10 runs</div> </div><br> <div class="card bg-success text-white"> <div class="card-body">India won by 7 wickets</div> </div> </div> </body> </html>