← Back to Bootstrap Course | Chapter 7: Components — Cards & Alerts | Lesson 2 of 7

Card का Header/Footer

Headers और footers एक card में labelled top और bottom strips add करते हैं।

In this page:

  1. Card Header/Footer
Syntax
markup
<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

body से पहले .card-header और इसके बाद .card-footer रखें। Headers nav tabs hold कर सकते हैं, और footers अक्सर timestamps या actions hold करते हैं। Coloured variants के लिए इन पर bg और text utilities इस्तेमाल करें, और पूरे cards के लिए .text-bg-*।

Note: card-header card-header-tabs के साथ nav-tabs भी hold कर सकता है।

उदाहरण: Card header/footer

markup
<!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/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. Header को body के अंदर रखना
  2. बिना hierarchy के अंदर headings इस्तेमाल करना
  3. inline CSS से style करना
चैप्टर सारांश
  • card-header ऊपर बैठता है
  • card-footer नीचे बैठता है
  • Utilities से Colour करें
  • Headers nav tabs hold कर सकते हैं
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.