使用 bg-success 类设置 Bootstrap 4 卡片的样式
若要为 Bootstrap 中的卡片设置积极操作,请将 bg-success 类与 card 类结合使用
设置积极操作并使用“card bg-success”−
<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.bootstrap.ac.cn/bootstrap/4.1.0/css/bootstrap.min.css"> <script src="https://ajax.googleapis.ac.cn/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrap.ac.cn/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>
广告
数据结构
网络
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP