انتقل إلى محتوى الدرس
الدرس 05
دورة Bootstrap

الالوان في BootStrapBootstrap Colors

ستتعلم في هذا الدرس كيفية تلوين النصوص بسهولة بعد اضافة بعض الكلاسات باستخدام اطار عمل bootstrap.

أقسام الدرس
4
الأمثلة
4
اللغة
العربية
تاريخ النشر
غير محدد
المشاهدات
5,234
محتوى الدرس
في هذا الدرس 4تصفّح المواضيع

يحتوي bootstrap على مجموعة كلاسات تستخدم لاضافة خلفية لاي عنصر بالوان تتناسب مع الغرض من هذا العنصر اذا كان عنوان رئيسي او تحذير او معلومات وغيرها.

الكلاس المستخدمة لاعطاء background هو *-bg حيث * هي احد هذه القيم ( primary - secondary - info- success - danger - warning - dark - light - white - body - transparent ).


Background Color Classes

استخدام كلاسات تغيير لون الخلفية.

HTML
<div class="container">
      <h2>Contextual Backgrounds</h2>
      <p>Use the contextual background classes to provide "meaning through colors".</p>
      <p>Note that you can also add a .text-* class if you want a different text color:</p>
      <p class="bg-primary text-white">This text is important.</p>
      <p class="bg-success text-white">This text indicates success.</p>
      <p class="bg-info text-white">This text represents some information.</p>
      <p class="bg-warning text-white">This text represents a warning.</p>
      <p class="bg-danger text-white">This text represents danger.</p>
</div>

لا يكتفي bootstrap باضافة لون للخلفية فقط, بل يوفر ايضا كلاسات لعمل gradient background خلفية متدرجة باستخدام كلاس bg-gradient عندما يتم اضافته بجانب كلاسات لون الخلفية التي ذكرناها قبل قليل.

Background Gradient

عمل خلفية متدرجة في bootstrap.

HTML
<div class="bg-primary bg-gradient text-white mt-3">primary gradient</div>

يحتوي bootstrap على مجموعة كلاسات يمكنها التحكم في الوان النصوص وكل لون له معني فمثلاً لعمل رساله تحذيرية فيمكنك استخدام كلاس warning. او كلاس danger.

وهذه هي كل كلاسات الالوان المتاحة في bootstrap حتى الان:

الكلاس لون النص
text-primary ازرق فاتح
text-secondary رمادي
text-info لبني
text-success اخضر
text-danger احمر
text-warning برتقالي
text-dark رمادي غامق
text-white ابيض
text-light رمادي بشفافية عالية
text-muted رمادي فاتح
text-body لون نص عنصر body



Text Colors

تطبيق الكلاسات الخاصة بالوان النصوص.

HTML
<div class="container">
      <p>Use the contextual classes to provide "meaning through colors":</p>
      <p class="text-muted">This text is muted.</p>
      <p class="text-primary">This text is important.</p>
      <p class="text-success">This text indicates success.</p>
      <p class="text-info">This text represents some information.</p>
      <p class="text-warning">This text represents a warning.</p>
</div>

في حالة استخدام كلاس text-black. (اللون الافتراضي للنص) او text-white. فيمكن كتابتهما بهذا الشكل text-black-50. او text-white-50. لاضافة شفافية بنسبة 50% لهذا النص.

Text Opacity

عمل شفافية بنسبة 50% للنصوص.

HTML
<div class="bg-danger text-white-50">Text Opacity 50%</div>
<div class="bg-warning text-black-50">Text Opacity 50%</div>

مشاركة

هل كان هذا الدرس مفيدًا؟

جارٍ تحميل الآراء…