Card header/footer
Headers and footers add labelled top and bottom strips to a card.
In this page:
Syntax
<div class="card">
<div class="card-header">Header</div>
<div class="card-body">Body</div>
<div class="card-footer">Footer</div>
</div>
Card header/footer
Place .card-header before the body and .card-footer after it. Headers can hold nav tabs, and footers often hold timestamps or actions. Use bg and text utilities on them for coloured variants, and .text-bg-* for whole cards.
Note:
card-header can also contain nav-tabs with card-header-tabs.
Example: Card header/footer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="p-3">
<div class="container">
<div class="card text-center">
<div class="card-header">Featured</div>
<div class="card-body"><h5 class="card-title">Special title</h5><p class="card-text">Supporting text.</p></div>
<div class="card-footer text-body-secondary">2 days ago</div>
</div>
</div>
</body>
</html>
Live Example
Related Topics
Common Mistakes
- Putting the header inside the body
- Using headings inside without hierarchy
- Styling with inline CSS
Chapter Summary
- card-header sits on top
- card-footer sits below
- Colour with utilities
- Headers can hold nav tabs
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: