Source

Okulaba okutwalira awamu

Ebitundu n'eby'okulonda eby'okuteekawo pulojekiti yo eya Bootstrap, omuli okuzinga ebitereke, enkola ya grid ey'amaanyi, ekintu ky'emikutu ekikyukakyuka, ne kiraasi z'ebikozesebwa eziddamu.

Ebintu ebiteekebwamu ebintu

Containers ze kintu ekisinga obukulu eky'ensengeka mu Bootstrap era zeetaagibwa nga okozesa enkola yaffe eya grid eya bulijjo . Londa okuva mu kibya ekiddamu, eky’obugazi obutakyukakyuka (ekitegeeza max-widthenkyukakyuka zaakyo ku buli kifo eky’okumenya) oba eky’obugazi bw’amazzi (ekitegeeza nti 100%kigazi buli kiseera).

Wadde nga ebitereke bisobola okuteekebwa mu kisu, ensengeka ezisinga tezeetaaga kibya kya kiyumba.

<div class="container">
  <!-- Content here -->
</div>

Kozesa .container-fluidku kibya eky'obugazi obujjuvu, nga kibuna obugazi bwonna obw'ekifo eky'okulaba.

<div class="container-fluid">
  ...
</div>

Ebifo ebimenya okuddamu

Okuva Bootstrap bwe yakolebwa okubeera essimu okusooka, tukozesa engalo entonotono ez’okubuuza kw’emikutu okukola ebifo ebitegeerekeka eby’okumenya ku nteekateeka zaffe n’enkolagana. Ebifo bino ebimenya bisinga kwesigamiziddwa ku bugazi bw’ekifo ekitunuuliddwa obutono ennyo era kitusobozesa okulinnyisa ebintu nga ekifo eky’okulaba kikyuka.

Bootstrap okusinga ekozesa emitendera gino wammanga egy’okubuuza emikutu —oba ebifo eby’okumenya —mu fayiro zaffe ez’ensibuko Sass ez’ensengeka yaffe, enkola ya grid, n’ebitundu.

// 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) { ... }

Okuva bwe tuwandiika source CSS yaffe mu Sass, ebibuuzo byaffe byonna eby’emikutu bifunibwa nga tuyita mu Sass mixins:

// 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;
  }
}

Oluusi n’oluusi tukozesa ebibuuzo by’emikutu ebigenda mu ludda olulala (obunene bwa screen obuweereddwa oba obutono ):

// 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

Weetegereze nti okuva browsers mu kiseera kino teziwagira range context queries , tukola okwetoloola obukwakkulizo bwa min-ne max-prefixes ne viewports ne fractional widths (ebiyinza okubaawo wansi w’embeera ezimu ku high-dpi devices, okugeza) nga tukozesa values ​​n’obutuufu obw’oku ntikko ku kugeraageranya kuno .

Nate, ebibuuzo bino eby’emikutu nabyo bifunibwa okuyita mu Sass mixins:

@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;
  }
}

Waliwo n’okubuuza kw’emikutu n’okutabula okutunuulira ekitundu kimu eky’obunene bwa ssirini nga tukozesa obugazi bw’okumenya obutono n’obusinga obunene.

// 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) { ... }

Ebibuuzo bino eby’emikutu gy’amawulire nabyo bifunibwa okuyita mu Sass mixins:

@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) { ... }

Mu ngeri y’emu, okubuuza kw’emikutu kuyinza okubuna obugazi bw’ebifo eby’okumenyawo ebingi:

// Example
// Apply styles starting from medium devices and up to extra large devices
@media (min-width: 768px) and (max-width: 1199.98px) { ... }

Sass mixin ey’okutunuulira ekika kya screen size y’emu yandibadde:

@include media-breakpoint-between(md, xl) { ... }

Z-omuwendo gw’ebintu

Ebitundu bya Bootstrap ebiwerako bikozesa z-index, ekintu kya CSS ekiyamba okufuga ensengeka nga kiwa ekisiki ekyokusatu okutegeka ebirimu. Tukozesa ekipimo kya z-index ekisookerwako mu Bootstrap ekikoleddwa okulayer obulungi okutambulira, ebikozesebwa ne popovers, modals, n'ebirala.

Emiwendo gino egy’oku ntikko gitandikira ku muwendo ogw’ekimpatiira, ogw’ekika ekya waggulu era ogw’enjawulo ekimala okusobola okwewala enkaayana mu ngeri ennungi. Twetaaga ekibiina eky’omutindo ekya bino okuyita mu bitundu byaffe ebiriko layeri —ebikozesebwa, popovers, navbars, dropdowns, modals —tusobole okuba abakwatagana mu ngeri entuufu mu nneeyisa. Tewali nsonga lwaki tetwandisobodde kukozesa 100+ oba 500+.

Tetukubiriza kulongoosa mpisa zino ez’omuntu kinnoomu; singa okyusa ekimu, kirabika weetaaga okuzikyusa zonna.

$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;

Okukwata ensalosalo ezikwatagana munda mu bitundu (okugeza, obutambi n’ebiyingizibwa mu bibinja by’ebiyingizibwa), tukozesa emiwendo gya digito emu z-indexegya wansi egya 1, 2, era 3ku mbeera ezisookerwako, ezisiba, n’ezikola. Ku hover/focus/active, tuleeta elementi entongole ku mwanjo z-indexn’omuwendo ogw’oku ntikko okulaga ensalosalo yaabwe ku elementi z’abooluganda.