使用 bg-dark 樣式 Bootstrap 4 卡片
在 Bootstrap 4 中使用 bg-dark 上下文樣式,為卡片新增灰色背景 −
在以下程式碼片段中,我使用了 bg-dark 樣式來設定 Bootstrap 卡樣式。除此之外,我還使用了 text-while 樣式來設定文字為白色 −
<div class="card bg-dark text-white"> <div class="card-body">This is it!</div> </div>
讓我們看看完整的示例以使用 bg-dark 樣式 −
示例
<!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>Notification</h2> <div class="card bg-dark text-white"> <div class="card-body">This is it!</div> </div><br> <div class="card"> <div class="card-body">How you doing?</div> </div><br> </div> </body> </html>
預告
資料結構
網路
關係型資料庫管理系統
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP