Bootstrap 4 卡片的 bg-light 类
bootstrapweb developmentcss framework更新于 2024/1/15 0:44:17
要为 Bootstrap 4 卡片设置浅灰色背景,请使用 bg-light 类。
像 Bootstrap 中的其他类一样使用"card bg-light"
<div class="card bg-light text-dark"> <div class="card-body">图片编辑器</div> </div>
以上代码为 Bootstrap 卡片设置了浅灰色背景。
让我们看一个 card-light 类的示例 −
示例
<!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"> <h2>Web Tools</h2> <div class="card bg-light text-dark"> <div class="card-body">Image Editor</div> </div> <div class="card bg-light text-dark"> <div class="card-body">Image Optimizer</div> </div> </div> </body> </html>

