引导程序 4 带有 bg-secondary 类样式的卡片
添加不太重要的内容,在引导程序中使用带有 bg-secondary 上下文类的卡片类。
此类添加了一个灰色背景 −
<div class="card bg-secondary text-white">
在其中,添加卡片正文 −
<div class="card bg-secondary text-white"> <div class="card-body">English</div> </div>
你可以尝试运行以下代码,在引导程序中用 bg-secondary 类实现 card 类 −
实例
<!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://ajax.googleapis.com/ajax/libs/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>Languages</h3> <div class="card bg-secondary text-white"> <div class="card-body">English</div> </div><br> <div class="card bg-secondary text-white"> <div class="card-body">French</div> </div><br> <div class="card bg-secondary text-white"> <div class="card-body">Chinese</div> </div><br> <div class="card bg-secondary text-white"> <div class="card-body">Russian</div> </div> </div> </body> </html>
广告