- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Add a title to any heading element in the Bootstrap 4 card
To add a title to any heading element in Bootstrap card, use the card-title class −
<h4 class="card-title"> Top Universities </h4>
The card-title class comes inside the card class in Bootstrap −
<div class="card-body"> <h4 class="card-title">Top Universities</h4> <p class="card-text">Stanford</p> <p class="card-text">Oxford</p> </div>
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"> <div class="card"> <div class="card-body"> <h4 class="card-title">Top Universities</h4> <p class="card-text">Stanford</p> <p class="card-text">Oxford</p> </div> </div> </div> </body> </html>
- Related Articles
- card-title class in Bootstrap 4
- Set subtitle after a title in Bootstrap 4 card
- Add a grey background color to the Bootstrap 4 card
- Add information with Bootstrap 4 card
- Add a heading container to Bootstrap panel
- Add a hover effect inside the Bootstrap 4 card
- Add a light grey background color to the Bootstrap 4 card
- Add a shadow to an element with Bootstrap 4
- Add small shadow to an element in Bootstrap 4
- Add large shadow to an element in Bootstrap 4
- Make an element look like a heading with Bootstrap
- Create a Bootstrap 4 card header
- Add bottom rounded corners to an element in Bootstrap 4
- Add top rounded corners to an element in Bootstrap 4
- Set positive action to the Bootstrap 4 card

Advertisements