Overview
Zvikamu uye sarudzo dzekuisa yako Bootstrap purojekiti, kusanganisira yekuputira midziyo, ine simba gidhi system, inoshanduka midhiya chinhu, uye inopindura zvekushandisa makirasi.
Containers
Containers ndiyo inonyanya kukosha dhizaini muBootstrap uye inodiwa kana uchishandisa yedu default grid system . Midziyo inoshandiswa kuve ne, pad, uye (dzimwe nguva) pakati pezviri mukati mazvo. Nepo midziyo inogona kuvharirwa, marongerwo mazhinji haadi chigadziko chine madendere.
Bootstrap inouya nemidziyo mitatu yakasiyana:
.container
, iyo inoisamax-width
pane imwe neimwe inopindura breakpoint.container-fluid
, iyo iriwidth: 100%
panguva dzese dzekutyora.container-{breakpoint}
, inovawidth: 100%
kusvika pane yakatarwa breakpoint
Tafura iri pazasi inoratidza kuti mudziyo wega wega max-width
unofananidzwa sei neyekutanga .container
uye .container-fluid
padanho rega rega rekutyora.
Vaone mukuita uye vaenzanise muGridhi yedu muenzaniso .
Yakawedzera diki <576px |
Diki ≥576px |
Pakati nepakati ≥768px |
Huru ≥992px |
Yakawedzera hombe ≥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% |
Zvese pamwechete
Yedu .container
yakasarudzika kirasi inopindura, yakagadziriswa-yakafara mudziyo, zvichireva max-width
shanduko dzayo pane imwe neimwe breakpoint.
Fluid
Shandisa .container-fluid
kune chigadziko chakazara chakafara, chinotenderera hupamhi hwese hwekutarisa.
Anoteerera
Anopindura midziyo mitsva muBootstrap v4.4. Ivo vanokutendera kuti utaure kirasi iyo iri 100% yakafara kusvika iyo yakatarwa breakpoint yasvika, mushure mezvo isu tinoisa max-width
s kune imwe neimwe yepamusoro breakpoints. Semuyenzaniso, .container-sm
i100% yakafara kutanga kusvika pasvika nzvimbo sm
yekuputsika, painozokwira ne md
, lg
, uye xl
.
Responsive breakpoints
Sezvo Bootstrap yakagadziridzwa kuti ive mbozha yekutanga, isu tinoshandisa mishoma yemibvunzo midhiya kugadzira inonzwisisika yekutyora kwemaitiro edu uye mainterface. Aya mabreakpoints anonyanya kuve akavakirwa pane mashoma ekutarisa upamhi uye anotibvumira kukwira kumusoro zvinhu sekuchinja kwekutarisa.
Bootstrap inonyanya kushandisa iyo inotevera midhiya yemubvunzo marenji-kana breakpoints-mune yedu sosi mafaera eSass edhizaini yedu, grid system, uye zvikamu.
Sezvo isu tichinyora yedu sosi CSS muSass, yedu yese midhiya mibvunzo inowanikwa kuburikidza neSass musanganiswa:
Isu dzimwe nguva tinoshandisa midhiya mibvunzo inoenda kune rimwe divi (iyo yakapihwa skrini saizi kana diki ):
Ziva kuti sezvo mabhurawuza pari zvino asingatsigire mivhunzo yezvimiro , isu tinoshanda zvakatenderedza min-
uye max-
prefixes uye nzvimbo dzekutarisa dzine hupamhi hwakaganhurwa (izvo zvinogona kuitika mune mamwe mamiriro pamichina yepamusoro-dpi, semuenzaniso) nekushandisa hunhu nehunyanzvi hwepamusoro pakuenzanisa uku. .
Zvekare, iyi midhiya mibvunzo inowanikwawo kuburikidza neSass musanganiswa:
Kune zvakare midhiya mibvunzo uye musanganiswa wekunongedza chikamu chimwe chete chehukuru hwescreen uchishandisa hudiki uye hwakanyanya breakpoint upamhi.
Iyi midhiya mibvunzo inowanikwawo kuburikidza neSass musanganiswa:
Saizvozvo, midhiya mibvunzo inogona kureba akawanda breakpoint wides:
Iyo Sass musanganiswa wekutarisa yakafanana skrini saizi renji ingave:
Z-index
Zvinoverengeka zveBootstrap zvinoshandisa z-index
, iyo CSS pfuma inobatsira kudzora marongero nekupa yechitatu axis kuronga zvirimo. Isu tinoshandisa yakasarudzika z-index chiyero muBootstrap iyo yakagadzirirwa kunyatso kurongedza kufamba, matipi ezvishandiso uye popovers, modal, nezvimwe.
Hunhu hwepamusoro uhwu hunotanga panhamba isingaverengeki, yakakwirira uye yakananga zvakakwana kudzivirira kunetsana. Tinoda yakajairwa seti yeizvi mukati mezvikamu zvedu zvakaturikidzana-zvishandiso, popovers, navbars, dropdowns, modals-kuti tigone kuenderana mune maitiro. Hapana chikonzero chatingadai tisina kushandisa 100
+ kana 500
+.
Hatikurudzire kugadziridzwa kwetsika dzemunhu idzi; kana ukachinja imwe chete, ungangoda kuichinja ese.
Kubata mabhodha anodhumhana mukati mezvikamu (semu, mabhatani nezvinoiswa mumapoka ekuisa), tinoshandisa yakaderera manhamba z-index
ma values e 1
, 2
, uye 3
kune default , hover, uye inoshanda matunhu. Pane hover/focus/active, tinounza chimwe chinhu kumberi chine z-index
kukosha kwepamusoro kuratidza muganho wavo pamusoro pezvinhu zvehama.