Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Style Bootstrap 4 card with bg-warning class
Use the bg-warning class with the card class in Bootstrap to set warning action on a Bootstrap card.
Set warning messages like −
Do not cross! High Voltage!
Use the below code to style a Bootstrap card −
<div class="card bg-warning"> <div class="card-body">You are trespassing on private property!</div> </div>
You can try to run the following code to style Bootstrap card with the bg-warning 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"> <h3>Warning</h3> <div class="card bg-warning"> <div class="card-body">You are trespassing on private property!</div> </div> </div> </body> </html>
Advertisements
