Bootstrap Classes का अवलोकन
Bootstrap में लगभग सब कुछ एक class name है, layout और spacing से लेकर colours और components तक।
In this page:
Syntax
<button class="btn btn-primary">text</button>
<div class="card shadow">...</div>
Bootstrap Classes Overview
Components .btn, .card, और .navbar जैसी base classes plus .btn-primary जैसे modifiers इस्तेमाल करते हैं। Utilities एक काम करती हैं, उदाहरण के लिए .mt-3 (margin), .text-center, .d-flex, और .bg-dark। कुछ classes combine करना CSS की कई lines की जगह लेता है।
Note:
पहले base class, फिर modifiers, फिर utilities।
उदाहरण: Bootstrap classes overview
<!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 text-center">
<span class="badge text-bg-primary">badge</span>
<button class="btn btn-outline-danger btn-sm mt-3">btn + modifier + size + utility</button>
<p class="text-uppercase fw-bold text-secondary mt-3">Utilities: text-uppercase, fw-bold, text-secondary, mt-3</p>
</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. #}
आम गलतियां
- इसकी base class के बिना एक modifier इस्तेमाल करना
- ऐसे class names बनाना जो exist नहीं करते
- inline styles से Bootstrap override करना
चैप्टर सारांश
- Base classes components बनाती हैं
- Modifiers variants बदलते हैं
- Utilities एक काम करती हैं
- UIs बनाने के लिए classes combine करें
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: