A tlangpuiin
I Bootstrap project laying out na tur component leh option hrang hrang, wrapping container, grid system chak tak, media object flexible tak, leh responsive utility class te pawh a tel.
Container te pawh a awm
Containers hi Bootstrap a layout element bulpui ber a ni a , kan default grid system kan hman hunah a mamawh a ni . Container te hi an chhunga thu awmte dahkhawmna, pad, leh (a chang chuan) center-na atan hman a ni. Container te hi nest theih a nih laiin, layout tam zawkah chuan nested container a ngai lo.
Bootstrap hian container hrang hrang pathum a keng tel a:
.container
max-width
, chu chuan responsive breakpoint tinah a set a.container-fluid
, chu chuwidth: 100%
breakpoint zawng zawngah a awm.container-{breakpoint}
, chu chuwidth: 100%
breakpoint tarlan thleng a ni
A hnuaia table hian container tinte max-width
chu original nen an khaikhin dan .container
leh .container-fluid
breakpoint tin across dan a tarlang a ni.
An thiltih danah en la kan Grid entirnan tehkhin rawh .
A tlem zawk <576px |
A te ≥576px a ni |
A laihawl ≥768px a ni |
A lian ≥992px a ni |
A lian zawk ≥1200px |
|
---|---|---|---|---|---|
.container |
100% a ni. | 540px a ni | 720px a ni | 960px a ni | 1140px a ni |
.container-sm |
100% a ni. | 540px a ni | 720px a ni | 960px a ni | 1140px a ni |
.container-md |
100% a ni. | 100% a ni. | 720px a ni | 960px a ni | 1140px a ni |
.container-lg |
100% a ni. | 100% a ni. | 100% a ni. | 960px a ni | 1140px a ni |
.container-xl |
100% a ni. | 100% a ni. | 100% a ni. | 100% a ni. | 1140px a ni |
.container-fluid |
100% a ni. | 100% a ni. | 100% a ni. | 100% a ni. | 100% a ni. |
All-in-one a awm vek
Kan default .container
class hi responsive, fixed-width container a ni a, max-width
breakpoint tinah a inthlak tihna a ni.
<div class="container">
<!-- Content here -->
</div>
Tuiril
Full width container atan hmang la .container-fluid
, viewport zau zawng zawng a huam vek ang.
<div class="container-fluid">
...
</div>
Chhanna pe thei
Bootstrap v4.4 ah hian responsive container te hi a thar a ni. Anni hian breakpoint tarlan a thlen hma loh chuan 100% wide class specify theihna an siam a, chu mi hnuah max-width
breakpoint sang zawk pakhat zel atan s kan apply thei a ni. Entirnan, breakpoint a thlen .container-sm
thlenga tan turin 100% wide a ni a, chutah chuan , , leh sm
hmangin a scale up ang .md
lg
xl
<div class="container-sm">100% wide until small breakpoint</div>
<div class="container-md">100% wide until medium breakpoint</div>
<div class="container-lg">100% wide until large breakpoint</div>
<div class="container-xl">100% wide until extra large breakpoint</div>
Chhanna pe thei breakpoints te
Bootstrap hi mobile atana siam hmasak a nih avangin media query tlemte hmangin kan layout leh interface te tan sensible breakpoint kan siam thin. Heng breakpoint te hi a tam zawk chu minimum viewport widths atanga siam a ni a, viewport a inthlak ang zelin elements te kan scale up theih phah a ni.
Bootstrap hian kan layout, grid system leh component hrang hrangte tan kan source Sass file-ah hian a hnuaia media query range—or breakpoint—te hi a hmang ber a ni.
// Extra small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
Sass-a kan source CSS kan ziah avangin kan media query zawng zawng hi Sass mixins hmangin a awm vek a:
// No media query necessary for xs breakpoint as it's effectively `@media (min-width: 0) { ... }`
@include media-breakpoint-up(sm) { ... }
@include media-breakpoint-up(md) { ... }
@include media-breakpoint-up(lg) { ... }
@include media-breakpoint-up(xl) { ... }
// Example: Hide starting at `min-width: 0`, and then show at the `sm` breakpoint
.custom-class {
display: none;
}
@include media-breakpoint-up(sm) {
.custom-class {
display: block;
}
}
Media query kan hmang fo thin a, chu chu kawng danga kal (screen size pek emaw a aia te emaw ):
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Small devices (landscape phones, less than 768px)
@media (max-width: 767.98px) { ... }
// Medium devices (tablets, less than 992px)
@media (max-width: 991.98px) { ... }
// Large devices (desktops, less than 1200px)
@media (max-width: 1199.98px) { ... }
// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width
min-
lehmax-
viewport-te limitation (chu chu high-dpi device-a condition thenkhat hnuaiah a thleng thei, entirnan) kan thawk ho
tih hre reng ang che .
Vawi khat chu heng media zawhnate hi Sass mixins hmangin a awm bawk:
@include media-breakpoint-down(xs) { ... }
@include media-breakpoint-down(sm) { ... }
@include media-breakpoint-down(md) { ... }
@include media-breakpoint-down(lg) { ... }
// No media query necessary for xl breakpoint as it has no upper bound on its width
// Example: Style from medium breakpoint and down
@include media-breakpoint-down(md) {
.custom-class {
display: block;
}
}
Breakpoint width tlem ber leh sang ber hmanga screen size segment pakhat target theihna tur media query leh mixin te pawh a awm bawk.
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) and (max-width: 767.98px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) and (max-width: 991.98px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) and (max-width: 1199.98px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
Heng media zawhnate hi Sass mixins hmangin a awm bawk:
@include media-breakpoint-only(xs) { ... }
@include media-breakpoint-only(sm) { ... }
@include media-breakpoint-only(md) { ... }
@include media-breakpoint-only(lg) { ... }
@include media-breakpoint-only(xl) { ... }
Chutiang bawkin media query te pawh hian breakpoint width tam tak a huam thei bawk:
// Example
// Apply styles starting from medium devices and up to extra large devices
@media (min-width: 768px) and (max-width: 1199.98px) { ... }
Screen size range inang target tur Sass mixin chu hetiang hi a ni ang:
@include media-breakpoint-between(md, xl) { ... }
Z-index a ni
Bootstrap component engemaw zatin z-index
, CSS property an hmang a, chu chuan layout control turin a pui a, content arrange turin third axis a pe a ni. Bootstrap ah hian default z-index scale kan hmang a, chu chu navigation, tooltips leh popovers, modals leh thil dang tam tak layer tha taka layer thei tura siam a ni.
Heng value sang zawkte hi duh duh number atanga tan a ni a, a sang leh a bik tawk a, a tha berah chuan buaina awm lo turin a intan thin. Kan layered component hrang hrangah hengte hi standard set kan mamawh a—tooltips, popovers, navbars, dropdowns, modals—chutiang chuan behaviors-ah hian reasonably consistent kan ni thei ang. 100
+ emaw + emaw kan hman theih loh chhan tur a awm lo 500
.
Heng mimal hlutnate hi customization kan fuih lo va; pakhat i thlak a nih chuan, i thlak vek a ngai mai thei.
$zindex-dropdown: 1000 !default;
$zindex-sticky: 1020 !default;
$zindex-fixed: 1030 !default;
$zindex-modal-backdrop: 1040 !default;
$zindex-modal: 1050 !default;
$zindex-popover: 1060 !default;
$zindex-tooltip: 1070 !default;
Component chhunga overlapping border (eg, input group-a button leh input) te handle tur chuan , , leh default, hover, leh active state-te tan single digit z-index
value hniam tak tak kan hmang bawk. Hover/focus/active-ah chuan element pakhat bik chu value sang zawk nen hmahruaituah kan rawn hruai a, chu chuan sibling element-te chunga an border a lantir theih nan.1
2
3
z-index