Kakaretso
Likarolo le likhetho tsa ho rala projeke ea hau ea Bootstrap, ho kenyelletsa le lijana tsa ho phuthela, sistimi e matla ea grid, ntho e feto-fetohang ea media, le litlelase tsa ts'ebeliso tse arabelang.
Lijana
Lits'oants'o ke karolo ea mantlha ea sebopeho ho Bootstrap 'me lia hlokahala ha u sebelisa sistimi ea rona ea kamehla . Lits'oants'o li sebelisetsoa ho kenyelletsa, pad, le (ka linako tse ling) li beha litaba tse ka hare ho tsona. Le hoja lijana li ka etsoa sehlaha, boholo ba libopeho ha li hloke setshelo sa sehlaha.
Bootstrap e tla le lijana tse tharo tse fapaneng:
.container
, e behang sebakamax-width
se seng le se seng se arabelang.container-fluid
, e lengwidth: 100%
likheo tsohle.container-{breakpoint}
, e lengwidth: 100%
ho fihlela sebaka se boletsoeng
Tafole e ka tlase e bonts'a hore na sets'oants'o ka seng se max-width
bapisoa joang le sa mantlha .container
le .container-fluid
ho pholletsa le sebaka se seng le se seng.
Li bone li sebetsa 'me u li bapise mohlaleng oa rona oa Grid .
E nyane haholo <576px |
E nyane ≥576px |
Hare ≥768px |
E kholo ≥992px |
E kholo haholo ≥1200px |
|
---|---|---|---|---|---|
.container |
100% | 540px | 720px | 960px | 1140px |
.container-sm |
100% | 540px | 720px | 960px | 1140px |
.container-md |
100% | 100% | 720px | 960px | 1140px |
.container-lg |
100% | 100% | 100% | 960px | 1140px |
.container-xl |
100% | 100% | 100% | 100% | 1140px |
.container-fluid |
100% | 100% | 100% | 100% | 100% |
Tsohle ka bonngwe
Sehlopha sa rona sa kamehla .container
ke setshelo se arabelang, se bophara bo tsitsitseng, ho bolelang max-width
liphetoho tsa sona sebakeng se seng le se seng.
Mokelikeli
Sebelisa .container-fluid
bakeng sa setshelo sa bophara bo felletseng, se pharalla ka bophara ba sebaka sa pono.
Ea arabelang
Lijana tse arabelang li ncha ho Bootstrap v4.4. Ba u lumella ho hlakisa sehlopha se bophara ba 100% ho fihlela sebaka se boletsoeng se fihletsoe, ka mor'a moo re sebelisa max-width
s bakeng sa sebaka se seng le se seng se phahameng. Mohlala, .container-sm
ke bophara ba 100% ho qala ho fihlela sebaka sa sm
phomolo se fihletsoe, moo se tla nyoloha ka md
, lg
, le xl
.
Li-breakpoints tse arabelang
Kaha Bootstrap e ntlafalitsoe hore e be selefouno pele, re sebelisa lipotso tse seng kae tsa mecha ea litaba ho theha likheo tse utloahalang bakeng sa meralo le lihokelo tsa rona. Hangata li-breakpoints tsena li ipapisitse le bophara ba bonyane ba sebaka sa pono, 'me li re lumella ho phahamisa likarolo ha sebaka sa pono se fetoha.
Bootstrap haholo-holo e sebelisa mefuta e latelang ea lipotso tsa mecha ea litaba-kapa li-breakpoints-mohloling oa rona oa lifaele tsa Sass bakeng sa sebopeho sa rona, tsamaiso ea grid, le likaroloana.
Kaha re ngola mohloli oa rona oa CSS ho Sass, lipotso tsohle tsa rona tsa media li fumaneha ka li-mixins tsa Sass:
Ka linako tse ling re sebelisa lipotso tsa media tse eang lehlakoreng le leng (saese e fanoeng skrineng kapa e nyane ):
Hlokomela hore kaha libatli ha joale ha li tšehetse lipotso tse amanang le litaba , re sebetsa ho pota-pota mefokolo ea min-
li max-
-prefixes le libaka tsa pono tse nang le bophara ba likaroloana (tse ka hlahang tlas'a maemo a itseng ho lisebelisoa tse phahameng tsa dpi, mohlala) ka ho sebelisa boleng bo nepahetseng haholo bakeng sa papiso ena. .
Hape, lipotso tsena tsa media li fumaneha hape ka li-mixins tsa Sass:
Ho boetse ho na le lipotso tsa mecha ea litaba le li-mixins bakeng sa ho shebana le karolo e le 'ngoe ea boholo ba skrine ho sebelisa bonyane le bophara bo boholo ba khefu.
Lipotso tsena tsa media li fumaneha hape ka li-mixins tsa Sass:
Ka mokhoa o ts'oanang, lipotso tsa media li ka akaretsa bophara ba libaka tse ngata:
Motsoako oa Sass bakeng sa ho shebana le boholo bo lekanang ba skrine e ka ba:
Z-index
Likarolo tse 'maloa tsa Bootstrap li sebelisa z-index
, thepa ea CSS e thusang ho laola sebopeho ka ho fana ka axis ea boraro ho hlophisa litaba. Re sebelisa sekala sa kamehla sa z-index ho Bootstrap se etselitsoeng hore se tsamaee hantle, lisebelisoa tsa lisebelisoa le popovers, modals, le tse ling.
Lintlha tsena tse holimo li qala ka palo e sa reroang, e phahameng le e tobileng ho qoba likhohlano. Re hloka sete e tloaelehileng ea lintho tsena ho pholletsa le likarolo tsa rona tse nang le lisebelisoa - lithulusi, popovers, navbar, dropdowns, modals - e le hore re ka tsitsa boitšoarong. Ha ho na lebaka leo re ka beng re sa ka ra sebelisa 100
+ kapa 500
+.
Ha re khothaletse ho fetola litekanyetso tsena tsa motho ka mong; Haeba u ka fetola e le 'ngoe, mohlomong u tla hloka ho li fetola kaofela.
Ho sebetsana le meeli e feteletsanang ka har'a likarolo (mohlala, likonopo le lintho tse kenang ka har'a lihlopha tsa ho kenya), re sebelisa boleng bo tlase ba nomoro e le 'ngoe z-index
ea 1
, 2
, le 3
bakeng sa maemo a kamehla, hover, le a active states. Ho hover/focus/active, re tlisa ntho e itseng ho ea pele ka z-index
boleng bo holimo ho bonts'a moeli oa bona holim'a likarolo tsa banab'abo.