बूटस्ट्रैप 4 ट्यूटोरियल

बीएस4 होम बीएस4 आरंभ करें बीएस4 कंटेनर बीएस4 ग्रिड बेसिक बीएस4 टाइपोग्राफी बीएस4 रंग बीएस4 टेबल्स बीएस4 इमेज बीएस4 जंबोट्रॉन बीएस4 अलर्ट बीएस4 बटन BS4 बटन समूह बीएस4 बैज बीएस4 प्रोग्रेस बार्स बीएस4 स्पिनर बीएस4 पेजिनेशन BS4 सूची समूह बीएस4 कार्ड बीएस4 ड्रॉपडाउन BS4 पतन बीएस4 नवस बीएस4 नवबार बीएस4 फॉर्म बीएस4 इनपुट BS4 इनपुट समूह बीएस4 कस्टम फॉर्म बीएस4 हिंडोला बीएस4 मोडल बीएस4 टूलटिप बीएस4 पॉपओवर बीएस4 टोस्ट बीएस4 स्क्रॉलस्पाई BS4 उपयोगिताएँ बीएस4 फ्लेक्स बीएस4 प्रतीक BS4 मीडिया ऑब्जेक्ट बीएस4 फिल्टर

बूटस्ट्रैप 4 ग्रिड

बीएस4 ग्रिड सिस्टम BS4 स्टैक्ड/क्षैतिज BS4 ग्रिड XSmall BS4 ग्रिड छोटा बीएस4 ग्रिड माध्यम BS4 ग्रिड बड़ा बीएस4 ग्रिड XLarge बीएस4 ग्रिड उदाहरण

बूटस्ट्रैप 4 अन्य

BS4 मूल टेम्पलेट बीएस4 व्यायाम बीएस4 प्रश्नोत्तरी

बूटस्ट्रैप 4 रेफरी

सभी वर्ग जेएस अलर्ट जे एस बटन जे एस हिंडोला जे एस संक्षिप्त जेएस ड्रॉपडाउन जेएस मोडल जेएस पॉपओवर जेएस स्क्रॉलस्पी जेएस टैब जेएस टोस्ट जेएस टूलटिप


बूटस्ट्रैप 4 फ्लेक्स


बूटस्ट्रैप 4 फ्लेक्स

बूटस्ट्रैप 4 घटकों के लेआउट को नियंत्रित करने के लिए फ्लेक्स क्लासेस का उपयोग करें।


फ्लेक्सबॉक्स

बूटस्ट्रैप 3 और बूटस्ट्रैप 4 के बीच सबसे बड़ा अंतर यह है कि बूटस्ट्रैप 4 अब लेआउट को संभालने के लिए फ्लोट्स के बजाय फ्लेक्सबॉक्स का उपयोग करता है।

फ्लेक्सिबल बॉक्स लेआउट मॉड्यूल, फ्लोट या पोजिशनिंग का उपयोग किए बिना लचीली उत्तरदायी लेआउट संरचना को डिजाइन करना आसान बनाता है। यदि आप फ्लेक्स के लिए नए हैं, तो आप इसके बारे में हमारे सीएसएस फ्लेक्सबॉक्स ट्यूटोरियल में पढ़ सकते हैं ।

नोट: फ्लेक्सबॉक्स IE9 और पुराने संस्करणों में समर्थित नहीं है।

यदि आपको IE8-9 समर्थन की आवश्यकता है, तो बूटस्ट्रैप 3 का उपयोग करें। यह बूटस्ट्रैप का सबसे स्थिर संस्करण है, और यह अभी भी महत्वपूर्ण बग फिक्स और दस्तावेज़ परिवर्तनों के लिए टीम द्वारा समर्थित है। हालांकि इसमें कोई नया फीचर नहीं जोड़ा जाएगा।

फ्लेक्सबॉक्स कंटेनर बनाने और सीधे बच्चों को फ्लेक्स आइटम में बदलने के लिए, d-flexकक्षा का उपयोग करें:

उदाहरण

Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex p-3 bg-secondary text-white">
  <div class="p-2 bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 bg-primary">Flex item 3</div>
</div>

इनलाइन फ्लेक्सबॉक्स कंटेनर बनाने के लिए, d-inline-flexकक्षा का उपयोग करें:

उदाहरण

Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-inline-flex p-3 bg-secondary text-white">
  <div class="p-2 bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 bg-primary">Flex item 3</div>
</div>

क्षैतिज दिशा

फ्लेक्स आइटम को क्षैतिज रूप से प्रदर्शित करने के लिए उपयोग करें .flex-row(अगल-बगल)। यह डिफ़ॉल्ट है।

युक्ति:.flex-row-reverse क्षैतिज दिशा को दाएँ-संरेखित करने के लिए उपयोग करें :

उदाहरण

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex flex-row bg-secondary">
  <div class="p-2 bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 bg-primary">Flex item 3</div>
</div>

<div class="d-flex flex-row-reverse bg-secondary">
  <div class="p-2 bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 bg-primary">Flex item 3</div>
</div>

लंबवत दिशा

.flex-columnफ्लेक्स आइटम को लंबवत (एक दूसरे के ऊपर) प्रदर्शित करने के लिए या .flex-column-reverse लंबवत दिशा को उलटने के लिए उपयोग करें:

उदाहरण

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex flex-column">
  <div class="p-2 bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 bg-primary">Flex item 3</div>
</div>

<div class="d-flex flex-column-reverse">
  <div class="p-2 bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 bg-primary">Flex item 3</div>
</div>


सामग्री को सही ठहराएं

.justify-content-*फ्लेक्स आइटम के संरेखण को बदलने के लिए कक्षाओं का उपयोग करें । मान्य वर्ग हैं start(डिफ़ॉल्ट), end, center, betweenया around:

उदाहरण

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex justify-content-start">...</div>
<div class="d-flex justify-content-end">...</div>
<div class="d-flex justify-content-center">...</div>
<div class="d-flex justify-content-between">...</div>
<div class="d-flex justify-content-around">...</div>

भरें / समान चौड़ाई

.flex-fillफ्लेक्स आइटम पर उन्हें समान चौड़ाई में बाध्य करने के लिए उपयोग करें :

उदाहरण

Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex">
  <div class="p-2 bg-info flex-fill">Flex item 1</div>
  <div class="p-2 bg-warning flex-fill">Flex item 2</div>
  <div class="p-2 bg-primary flex-fill">Flex item 3</div>
</div>

बढ़ना

.flex-grow-1बाकी जगह लेने के लिए फ्लेक्स आइटम पर प्रयोग करें । नीचे दिए गए उदाहरण में, पहले दो फ्लेक्स आइटम अपना आवश्यक स्थान लेते हैं, जबकि अंतिम आइटम शेष उपलब्ध स्थान लेता है:

उदाहरण

Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex">
  <div class="p-2 bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 bg-primary flex-grow-1">Flex item 3</div>
</div>

युक्ति:.flex-shrink-1 यदि आवश्यक हो तो इसे सिकोड़ने के लिए किसी फ्लेक्स आइटम पर उपयोग करें ।


आदेश

.orderकक्षाओं के साथ एक विशिष्ट फ्लेक्स आइटम का दृश्य क्रम बदलें । मान्य वर्ग 0 से 12 तक हैं, जहां सबसे कम संख्या को सर्वोच्च प्राथमिकता दी जाती है (आदेश -1 को आदेश -2, आदि से पहले दिखाया जाता है ..):

उदाहरण

Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex bg-secondary">
  <div class="p-2 bg-info order-3">Flex item 1</div>
  <div class="p-2 bg-warning order-2">Flex item 2</div>
  <div class="p-2 bg-primary order-1">Flex item 3</div>
</div>

ऑटो मार्जिन

फ्लेक्स आइटम में आसानी से ऑटो मार्जिन जोड़ें .mr-auto(आइटम को दाईं ओर पुश करें), या .ml-auto(आइटम को बाईं ओर पुश करें) का उपयोग करके:

उदाहरण

Flex item 1
Flex item 2
Flex item 3
Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex bg-secondary">
  <div class="p-2 mr-auto bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 bg-primary">Flex item 3</div>
</div>

<div class="d-flex bg-secondary">
  <div class="p-2 bg-info">Flex item 1</div>
  <div class="p-2 bg-warning">Flex item 2</div>
  <div class="p-2 ml-auto bg-primary">Flex item 3</div>
</div>


चादर

नियंत्रित करें कि कैसे फ्लेक्स आइटम एक फ्लेक्स कंटेनर में .flex-nowrap(डिफ़ॉल्ट), .flex-wrapया .flex-wrap-reverse.

उदाहरण बॉक्स में फ्लेक्स आइटम के रैपिंग को बदलकर, तीन वर्गों के बीच अंतर देखने के लिए नीचे दिए गए बटनों पर क्लिक करें:

उदाहरण

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

उदाहरण

<div class="d-flex flex-wrap">..</div>

<div class="d-flex flex-wrap-reverse">..</div>

<div class="d-flex flex-nowrap">..</div>

सामग्री संरेखित करें

कक्षाओं के साथ एकत्रित फ्लेक्स आइटम के लंबवत संरेखण को नियंत्रित करें । .align-content-*मान्य वर्ग हैं .align-content-start(डिफ़ॉल्ट), .align-content-end, .align-content-center, .align-content-between, .align-content-aroundऔर .align-content-stretch

नोट: इन वर्गों का फ्लेक्स आइटम की एकल पंक्तियों पर कोई प्रभाव नहीं पड़ता है।

उदाहरण बॉक्स में फ्लेक्स आइटम के लंबवत संरेखण को बदलकर, पांच वर्गों के बीच अंतर देखने के लिए नीचे दिए गए बटनों पर क्लिक करें:

उदाहरण

Flex item 1
Flex item 2
Flex item 3
Flex item 4
Flex item 5
Flex item 6
Flex item 7
Flex item 8
Flex item 9
Flex item 10
Flex item 11
Flex item 12
Flex item 13
Flex item 14
Flex item 15
Flex item 16
Flex item 17
Flex item 18
Flex item 19
Flex item 20
Flex item 21
Flex item 22
Flex item 23
Flex item 24
Flex item 25

उदाहरण

<div class="d-flex flex-wrap align-content-start">..</div>

<div class="d-flex flex-wrap align-content-end">..</div>

<div class="d-flex flex-wrap align-content-center">..</div>

<div class="d-flex flex-wrap align-content-around">..</div>

<div class="d-flex flex-wrap align-content-stretch">..</div>

आइटम संरेखित करें

कक्षाओं के साथ फ्लेक्स आइटम की एकल पंक्तियों के लंबवत संरेखण को नियंत्रित करें । .align-items-*मान्य वर्ग हैं .align-items-start, .align-items-end, .align-items-center, .align-items-baseline, और .align-items-stretch (डिफ़ॉल्ट)।

पांच वर्गों के बीच अंतर देखने के लिए नीचे दिए गए बटनों पर क्लिक करें:

उदाहरण

Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex align-items-start">..</div>

<div class="d-flex align-items-end">..</div>

<div class="d-flex align-items-center">..</div>

<div class="d-flex align-items-baseline">..</div>

<div class="d-flex align-items-stretch">..</div>

स्वयं संरेखित करें

कक्षाओं के साथ निर्दिष्ट फ्लेक्स आइटम के लंबवत संरेखण को नियंत्रित करें । .align-self-*मान्य वर्ग हैं .align-self-start, .align-self-end, .align-self-center, .align-self-baseline, और .align-self-stretch (डिफ़ॉल्ट)।

पांच वर्गों के बीच अंतर देखने के लिए नीचे दिए गए बटनों पर क्लिक करें:

उदाहरण

Flex item 1
Flex item 2
Flex item 3

उदाहरण

<div class="d-flex bg-light" style="height:150px">
  <div class="p-2 border">Flex item 1</div>
  <div class="p-2 border align-self-start">Flex item 2</div>
  <div class="p-2 border">Flex item 3</div>
</div>

रेस्पॉन्सिव फ्लेक्स क्लासेस

All flex classes comes with additional responsive classes, which makes it easy to set a specific flex class on a specific screen size.

The * symbol can be replaced with sm, md, lg or xl, which represents small, medium, large or xlarge screens.

Class Description Example
Flex Container    
.d-*-flex Creates a flexbox container for different screens
.d-*-inline-flex Creates an inline flexbox container for different screens
Direction    
.flex-*-row Display flex items horizontally on different screens
.flex-*-row-reverse Display flex items horizontally, and right-aligned, on different screens
.flex-*-column Display flex items vertically on different screens
.flex-*-column-reverse Display flex items vertically, with reversed order, on different screens screens
Justified Content    
.justify-content-*-start Display flex items from the start (left-aligned) on different screens
.justify-content-*-end Display flex items at the end (right-aligned) on different screens
.justify-content-*-center Display flex items in the center of a flex container on different screens
.justify-content-*-between Display flex items in "between" on different screens
.justify-content-*-around Display flex items "around" on different screens
Fill / Equal Width    
.flex-*-fill Force flex items into equal widths on different screens
Grow    
.flex-*-grow-0 Don't make the items grow on different screens  
.flex-*-grow-1 Make items grow on different screens  
Shrink    
.flex-*-shrink-0 Don't make the items shrink on diferent screens  
.flex-*-shrink-1 Make items shrink on different screens  
Order    
.order-*-0-12 Change the order from 0 to 12 on small screens
Wrap    
.flex-*-nowrap Don't wrap items on different screens
.flex-*-wrap Wrap items on different screens
.flex-*-wrap-reverse Reverse the wrapping of items on different screens
Align Content    
.align-content-*-start Align gathered items from the start on different screens
.align-content-*-end Align gathered items at the end on different screens
.align-content-*-center Align gathered items in the center on different screens
.align-content-*-around Align gathered items "around" on different screens
.align-content-*-stretch Stretch gathered items on different screens
Align Items    
.align-items-*-start Align single rows of items from the start on different screens
.align-items-*-end Align single rows of items at the end on different screens
.align-items-*-center Align single rows of items in the center on different screens
.align-items-*-baseline Align single rows of items on the baseline on different screens
.align-items-*-stretch Stretch single rows of items on different screens
Align Self    
.align-self-*-start Align a flex item from the start on different screens
.align-self-*-end Align a flex item at the end on different screens
.align-self-*-center Align a flex item in the center on different screens
.align-self-*-baseline Align a flex item on the baseline on different screens
.align-self-*-stretch Stretch a flex item on different screens