- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
bg-light class for Bootstrap 4 cards
To set a light grey background for the Bootstrap 4 cards, use the bg-light class.
Use “card bg-light” like any other class in Bootstrap −
<div class="card bg-light text-dark"> <div class="card-body">Image Editor</div> </div>
The above gives a light grey background to the Bootstrap card.
Let us see an example of the card-light class −
Example
<!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>
- Related Articles
- Style Bootstrap 4 cards with bg-danger class
- Style Bootstrap 4 cards with bg-dark class
- Style Bootstrap 4 card with bg-primary class
- Bootstrap 4 card styled with bg-secondary class
- Style Bootstrap 4 card with bg-warning class
- Style Bootstrap 4 card with bg-success class
- Bootstrap 4 .border-light class
- Style Bootstrap card with bg-info class
- Bootstrap 4 Button .btn-outline-light class
- Create a grid of cards using Bootstrap 4 .card-deck class
- Set negative action for Bootstrap 4 cards with red background color
- Container to create a grid of Bootstrap 4 cards
- Bootstrap 4 .rounded-circle class
- Bootstrap 4 .card-text class
- Bootstrap 4 .border-danger class

Advertisements