Izikhongozeli
Izikhongozeli zisisiseko sokwakha iBootstrap equlathe, iphedi, kunye nokulungelelanisa umxholo wakho kwisixhobo esinikiweyo okanye indawo yokujonga.
Indlela abasebenza ngayo
Imigqomo yeyona nto isisiseko uyilo kwiBootstrap kwaye iyafuneka xa usebenzisa inkqubo yethu yegridi engagqibekanga . Izikhongozeli zisetyenziselwa ukuqulatha, iphedi, kwaye (ngamanye amaxesha) iziko lomxholo ophakathi kwazo. Ngelixa izikhongozeli zinokubekwa kwindlwane, uninzi lwezakhiwo azifuni sikhongozeli esinendlwane.
I-Bootstrap iza nezikhongozeli ezintathu ezahlukeneyo:
.container
, emisela amax-width
kwindawo nganye yokusabela esabelayo.container-{breakpoint}
, elide libe yindawowidth: 100%
ekhankanyiweyo yokwaphuka.container-fluid
, ekuthiwidth: 100%
kuzo zonke iindawo zokuqhawuka
Itheyibhile engezantsi ibonisa ukuba isikhongozeli ngasinye sithelekiseka njani max-width
nesokuqala .container
nakwindawo .container-fluid
yoqhawulo nganye.
Zibone zisebenza kwaye uzithelekise kumzekelo wethu weGridi .
Incinci kakhulu
<576px
|
Incinci
≥576px
|
Phakathi
≥768px
|
Enkulu
≥992px
|
X-Enkulu
≥1200px
|
XX-Enkulu
≥1400px
|
|
---|---|---|---|---|---|---|
.container |
100% | 540px | 720px | 960px | 1140px | 1320px |
.container-sm |
100% | 540px | 720px | 960px | 1140px | 1320px |
.container-md |
100% | 100% | 720px | 960px | 1140px | 1320px |
.container-lg |
100% | 100% | 100% | 960px | 1140px | 1320px |
.container-xl |
100% | 100% | 100% | 100% | 1140px | 1320px |
.container-xxl |
100% | 100% | 100% | 100% | 100% | 1320px |
.container-fluid |
100% | 100% | 100% | 100% | 100% | 100% |
Isikhongozeli esihlala sihleli
Udidi lwethu olungagqibekanga .container
sisikhongozeli esiphendulayo, esinobubanzi obusisigxina, okuthetha ukuba max-width
utshintsho lwaso kwindawo nganye yoqhawulo.
<div class="container">
<!-- Content here -->
</div>
Izikhongozeli eziphendulayo
Izikhongozeli eziphendulayo zikuvumela ukuba uchaze udidi oluyi-100% ububanzi de kufike i-breakpoint echaziweyo, emva koko sisebenzise max-width
i-s kwi-breakpoints nganye ephezulu. Umzekelo, .container-sm
i-100% ububanzi ukuqala de kufike indawo sm
yokuphumla, apho iya kunyuka nge md
, lg
, xl
, kunye xxl
.
<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>
<div class="container-xxl">100% wide until extra extra large breakpoint</div>
Izikhongozeli zolwelo
Sebenzisa .container-fluid
kwisikhongozeli esibanzi esigcweleyo, esinaba bonke ububanzi bendawo yokujonga.
<div class="container-fluid">
...
</div>
Sass
Njengoko kubonisiwe ngasentla, iBootstrap ivelisa uthotho lweeklasi ezichazwe kwangaphambili zesikhongozeli ukukunceda ukuba wakhe uyilo olunqwenelayo. Unokwenza ezi klasi zichazwe kwangaphambili zesikhongozeli ngokuguqula imephu ye-Sass (efumaneka kwi _variables.scss
) ebanika amandla:
$container-max-widths: (
sm: 540px,
md: 720px,
lg: 960px,
xl: 1140px,
xxl: 1320px
);
Ukongeza ekwenzeni ngokwezifiso i-Sass, unokwenza izikhongozeli zakho ngomxube wethu we-Sass.
// Source mixin
@mixin make-container($padding-x: $container-padding-x) {
width: 100%;
padding-right: $padding-x;
padding-left: $padding-x;
margin-right: auto;
margin-left: auto;
}
// Usage
.custom-container {
@include make-container();
}
Ngolwazi oluthe vetshe kunye nemizekelo malunga nendlela yokutshintsha iimephu zethu ze-Sass kunye nezinto eziguquguqukayo, nceda ujonge icandelo le-Sass leGridi yamaxwebhu .