Nsɛm a Wɔaka abom
Nneɛma ne akwan a wobɛfa so asiesie wo Bootstrap adwuma no, a nea ɛka ho ne wrapping containers, grid nhyehyɛe a ahoɔden wom, media ade a ɛyɛ mmerɛw, ne utility classes a ɛyɛ mmuae.
Containers yɛ nhyehyɛe element titiriw wɔ Bootstrap mu na ɛho hia bere a wode yɛn default grid nhyehyɛe no redi dwuma no . Paw fi ade a ɛyɛ adwuma, a ne tɛtrɛtɛ gyina hɔ (a ɛkyerɛ sɛ max-width
ɛsakra wɔ beae biara a ɛpaapae) anaasɛ nsu a ɛtrɛw (a ɛkyerɛ sɛ 100%
ɛtrɛw bere nyinaa).
Bere a wobetumi ayɛ nkorabata no nest no, nhyehyɛe dodow no ara nhia sɛ wɔde nkorabata a wɔde ahyɛ mu.
Fa di dwuma .container-fluid
ma ade a ne tɛtrɛtɛ nyinaa, a ɛtrɛw hwɛbea no ntrɛwmu nyinaa.
Esiane sɛ wɔayɛ Bootstrap sɛ ɛnyɛ mobile kan nti, yɛde media nsɛmmisa kakraa bi di dwuma de yɛ breakpoints a ntease wom ma yɛn layouts ne interfaces. Saa breakpoints yi gyina viewport widths a ɛsua koraa so na ɛma yɛn kwan ma yɛ scale up elements bere a viewport no sesa no.
Bootstrap de media asɛmmisa kwan a edidi so yi di dwuma titiriw—anaasɛ breakpoints—wɔ yɛn source Sass fael ahorow no mu ma yɛn nhyehyɛe, grid nhyehyɛe, ne nneɛma a ɛwom no.
Esiane sɛ yɛkyerɛw yɛn source CSS wɔ Sass mu nti, yɛn media nsɛmmisa nyinaa wɔ hɔ denam Sass mixins so:
Ɛtɔ mmere bi a yɛde media nsɛmmisa a ɛkɔ ɔkwan foforo so (screen size a wɔde ama anaa nea ɛsua ) di dwuma:
Hyɛ no nsow sɛ esiane sɛ mprempren browser ahorow ntumi mmoa range context queries , yɛyɛ adwuma twa anohyeto ahorow a ɛwɔ min-
ne max-
prefixes ne viewports a ɛwɔ fractional widths (a ebetumi aba wɔ tebea horow bi mu wɔ high-dpi mfiri ahorow so, sɛ nhwɛso no) ho dwuma denam values a ɛwɔ pɛpɛɛpɛyɛ a ɛkorɔn a yɛde di dwuma ma saa ntotoho ahorow yi so .
Saa bere yi nso, saa media nsɛmmisa yi nso wɔ hɔ denam Sass mixins so:
Afei nso media nsɛmmisa ne mixins wɔ hɔ a wɔde si screen akɛseɛ fã baako a wɔde breakpoint widths a ɛsua ne kɛseɛ di dwuma.
Saa media nsɛmmisa yi nso wɔ hɔ denam Sass mixins so:
Saa ara nso na media nsɛmmisa betumi atrɛw breakpoint ntrɛwmu pii:
Sass mixin a wɔde bɛto screen size range koro no ara so no bɛyɛ:
Bootstrap afã horow pii de di dwuma z-index
, CSS agyapade a ɛboa ma wɔhwɛ nhyehyɛe so denam axis a ɛto so abiɛsa a wɔde ma de hyehyɛ nsɛm no so. Yɛde default z-index scale di dwuma wɔ Bootstrap mu a wɔayɛ sɛ ɛbɛma layer navigation, adwinnade ho nsɛm ne popovers, modals, ne nea ɛkeka ho yiye.
Saa gyinapɛn ahorow a ɛkorɔn yi fi ase wɔ dodow a wɔmpɛ so, a ɛkorɔn na ɛyɛ pɔtee sɛnea ɛbɛyɛ a ɛbɛyɛ papa sɛ wɔbɛkwati ntawntawdi. Yɛhia eyinom a wɔahyehyɛ no gyinapɛn wɔ yɛn afã horow a wɔayɛ no ntoatoaso no nyinaa mu —adwinnade ho nsɛm, popovers, navbars, dropdowns, modals —sɛnea ɛbɛyɛ a yebetumi ayɛ nea ɛfata wɔ nneyɛe no mu. Biribiara nni hɔ a enti anka yɛrentumi mfa 100
+ anaa 500
+ nni dwuma.
Yɛnhyɛ saa ankorankoro gyinapɛn ahorow yi a wɔbɛsakra no ho nkuran; sɛ wosakra biako a, ɛda adi sɛ ɛsɛ sɛ wosakra ne nyinaa.
Sɛ yɛbɛdi ahyeɛ a ɛka bom wɔ afã ahodoɔ no mu ho dwuma (sɛ nhwɛsoɔ no, bɔtɔn ne nsɛm a wɔde hyɛ mu wɔ nsɛm a wɔde hyɛ mu akuo mu), yɛde digit baako z-index
botaeɛ a ɛba fam a ɛyɛ 1
, 2
, ne 3
default, hover, ne tebea a ɛyɛ adwuma di dwuma. Wɔ hover/focus/active so no, yɛde element pɔtee bi ba anim a ɛwɔ z-index
bo a ɛkorɔn de kyerɛ wɔn hye wɔ anuanom element ahorow no so.