Text के रंग
Text colour utilities text में Bootstrap के theme colours apply करती हैं।
In this page:
Syntax
<p class="text-primary">text</p>
<p class="text-danger">text</p>
Text Colors
.text-primary, .text-success, .text-danger, और .text-warning जैसी classes theme इस्तेमाल करते हुए text colour करती हैं। .text-body-secondary और .text-body-emphasis light और dark modes के हिसाब से adapt होते हैं। एक accessible text colour के साथ एक background pair करने के लिए .text-bg-* इस्तेमाल करें।
Note:
अकेला Colour meaning carry नहीं करना चाहिए; text या icons भी add करें।
उदाहरण: Text colors
<!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">
<p class="text-primary">Primary</p>
<p class="text-success">Success</p>
<p class="text-danger">Danger</p>
<p class="text-warning-emphasis bg-warning-subtle p-1">Warning emphasis on subtle background</p>
<p class="text-body-secondary">Secondary body text</p>
<span class="badge text-bg-dark">text-bg-dark</span>
</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. #}
आम गलतियां
- state convey करने के लिए सिर्फ colour पर depend करना
- low contrast combinations इस्तेमाल करना
- version 5.3 में text-body-secondary की बजाय text-muted इस्तेमाल करना
चैप्टर सारांश
- text-primary, success, danger, warning jaise classes मिलती हैं
- text-body-secondary dark mode के हिसाब से adapt होता है
- text-bg-* colours pair करता है
- सिर्फ colour पर depend न करें
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: