Bootstrap bɛ jɔ jatebɔlan 12 kan min bɛ jaabi di. An ye labɛncogo jɔlenw ni jilamaw fana Dòn a la minnu sinsinnen bɛ o cogoya kan.
Bootstrap bɛ baara Kɛ ni HTML fɛnw ni CSS nafaw ye minnu bɛ HTML5 doctype baara de wajibiya. Aw ye aw jija k’a don Bootstrapped ɲɛ kelen-kelen bɛɛ daminɛ na aw ka porozɛ kɔnɔ.
- <!DOCTYPE html> ye
- <html lang = "en" >
- ...
- </html>
Scaffolding.less file kɔnɔ , an bɛ diɲɛ jiracogo jɔnjɔnw, sɛbɛnnikɛcogo ani ɲɔgɔndan cogoyaw sigi sen kan. Kɛrɛnkɛrɛnnenya la, anw:
background-color: white;
kan ka ...body
@baseFontFamily
, @baseFontSize
, ani @baseLineHeight
fɛnw ye i n’a fɔ an ka sɛbɛnnikɛcogo basigilen@linkColor
ani ka link underlines dɔrɔn de kɛ:hover
Kabini Bootstrap 2 la, CSS laadalata labɛnni jiginna ka baara kɛ ni fɛnw ye minnu bɛ bɔ Normalize.css , o ye porozɛ ye Nicolas Gallagher fɛ min fana bɛ fanga di HTML5 Boilerplate ma .
Segin kura bɛ se ka sɔrɔ hali bi reset.less kɔnɔ , nka ni fɛn caman bɔra a la walasa ka surunya ani ka tiɲɛ.
Grid system default min bɛ di Bootstrap kɔnɔ, o bɛ baara kɛ ni kulu 12 ye minnu bɛ jira ni u bonya ye 724px, 940px (default ni CSS jaabilen tɛ a la), ani 1170px. 767px filɛliyɔrɔw jukɔrɔ, kuluw bɛ kɛ ji ye ani u bɛ ɲɔgɔn dalajɛ jɔlen na.
- <div kalasi = "lafiɲɛbɔ" >
- <div kalasi = "span4" > ... </div>
- <div kalasi = "span8" > ... </div>
- </div> ye
I n'a fɔ a jiralen bɛ cogo min na yan, layidu jɔnjɔn dɔ bɛ Se ka Dabɔ ni "kolon" fla ye, u kelen-kelen bɛɛ bɛ dakun jusigilan 12 hakɛ dɔ Dabɔ an ye minnu ɲɛfɔ i n'a fɔ an ka jatebɔ-sigida dɔ.
- <div kalasi = "lafiɲɛbɔ" >
- <div kalasi = "span4" > ... </div>
- <div kalasi = "span4 bɛrɛbɛrɛ4" > ... </div>
- </div> ye
Ni static (non-fluid) grid system ye Bootstrap kɔnɔ, nesting ka nɔgɔn. Walasa k’i ka kɔnɔkow labɛn, i bɛ kulu kura .row
ni kulu dɔ fara dɔrɔn .span*
kulu dɔ kɔnɔ min bɛ yen .span*
.
Nested rows ka kan ka kuluw kulu dɔ Sɔrɔ minnu bɛ Fàra ɲɔgɔn kan ka Kɛ a bangebaga kuluw hakɛ ye. Misali la, kulu fila minnu bɛ sigi ɲɔgɔn .span3
kan, olu ka kan ka bila .span6
.
- <div kalasi = "lafiɲɛbɔ" >
- <div kalasi = "span6" >
- Nivo 1 kulu
- <div kalasi = "lafiɲɛbɔ" >
- <div kalasi = "span3" > Dakun 2nan </div>
- <div kalasi = "span3" > Dakun 2nan </div>
- </div> ye
- </div> ye
- </div> ye
Fluid grid system bɛ baara kɛ ni kɛmɛsarada ye kolonw bonya kama sanni ka kɛ pixel fixes ye. A fana bɛ ni jaabi caman ɲɔgɔnna ye i n’a fɔ an ka grid fixe system, o bɛ a to proportion bɛnnenw ka ɲɛsin key screen resolutions ni minɛnw ma.
Aw bɛ jirisun o jirisun kɛ ji ye dɔrɔn ni aw bɛ fɛn caman Changer .row
ka kɛ .row-fluid
. Kolonw bɛ to u cogo kelen na tigitigi, o b’a to a bɛ super straightforward kɛ ka flip kɛ fixe ni fluid layouts cɛ.
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span4" > ... </div>
- <div kalasi = "span8" > ... </div>
- </div> ye
Nesting ni fluid grids bɛ danfara dɔɔnin: nested columns hakɛ man kan ka bɛn bangebaga ma. O nɔ na, i ka kuluw bɛ Lasegin nivo kelen-kelen bɛɛ la bawo jirisun kelen-kelen bɛɛ bɛ 100% ta bangebaga kulu la.
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span12" >
- Nivo 1 ka kulu
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span6" > Dakun 2nan </div>
- <div kalasi = "span6" > Dakun 2nan </div>
- </div> ye
- </div> ye
- </div> ye
Yɛlɛma-yɛlɛma | Nafa min bɛ sɔrɔ a daminɛ na | Cogojirali |
---|---|---|
@gridColumns |
12 ye | Kolonw hakɛ |
@gridColumnWidth |
60px ye | Kolon kelen-kelen bɛɛ bonya |
@gridGutterWidth |
20px ye | Yɔrɔ jugu bɛ kolonw ni ɲɔgɔn cɛ |
Built into Bootstrap ye fɛn damadɔ ye minnu bɛ se ka 940px grid system default ladilan, minnu sɛbɛnnen don sanfɛ. Jateminεw bεε bε mara bεnkanw na.less.
Grid (jatebɔ) bεε bεε bε Yεlεma cogo min na, o kɔrɔ ye ka fɛn saba @grid*
bεε bε Yεlεma ani ka Bootstrap labɛn kokura. fɛn caman Changer grid variables dans variables.less ani ka baara kɛ ni fɛɛrɛ naani dɔ ye minnu sɛbɛnnen don walasa ka ɲɔgɔn lajɛ kokura . N'i bɛ kulu wɛrɛw fara a kan, i jija ka CSS fara a kan minnu bɛ grid.less kɔnɔ.
Grid customization bɛ baara kɛ dɔrɔn nivo default la, n’o ye 940px grid ye. Walasa ka Bootstrap jaabi fanw mara, i bɛna gridw fana ladamu responsive.less kɔnɔ.
A daminɛ na ani a nɔgɔn 940px-wide, centered layout for just about any site web or page provided by a single <div class="container">
.
- <farikolo>
- <div kalasi = "minɛn" >
- ...
- </div> ye
- </farikolo>
<div class="container-fluid">
bɛ ɲɛw sigicogo sɛgɛsɛgɛlen di, min- ani max-widths, ani kininbolo fan dɔ. A ka ɲi kosɛbɛ apps ani docs ma.
- <div kalasi = "minɛn-ji" >
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span2" >
- <!--Kɛrɛfɛla kɔnɔkow-->
- </div> ye
- <div kalasi = "span10" >
- <!--Farakolo kɔnɔkow-->
- </div> ye
- </div> ye
- </div> ye
Media ɲininkaliw bɛ sira Di CSS ladamulen ma ka da cogoya damadɔ kan—hakɛw, bonya, jiracogo suguya, a ɲɔgɔnnaw—nka a ka c’a la, u bɛ sinsin min-width
ani max-width
.
Baara kɛ ni kunnafonidilanw ɲininkaliw ye ni hakilitigiya ye ani dɔrɔn i n’a fɔ daminɛ i ka telefɔni selilɛri lamɛnbagaw fɛ. Porozɛbaw kama, aw bɛ jateminɛ kɛ kode basigilenw kɛrɛnkɛrɛnnenw na, aw kana jateminɛ kɛ kunnafonidilanw ɲininkaliw layɛrɛw la.
Bootstrap bɛ kunnafonidi ɲininkali damadɔ dɛmɛ dosiye kelen kɔnɔ walasa k’aw dɛmɛ k’aw ka porozew kɛ ka bɛn minɛnw ni ɛkran ɲɛfɔli suguya wɛrɛw ma. Fɛn minnu bɛ a kɔnɔ, olu filɛ nin ye:
Tàamasiyɛn | Layout ka bonya | Kolon bonya | Gutter bonya |
---|---|---|---|
Telefɔni hakilitigiw | 480px ani a duguma | Kolonw jilamaw, u bonya jɔlen tɛ | |
Telefɔni hakilitigiw ka taa tablɛtiw la | 767px ani a duguma | Kolonw jilamaw, u bonya jɔlen tɛ | |
Ja tablɛtiw | 768px ani a sanfɛ | 42px ye | 20px ye |
Fɔlɔ | 980px ani ka tɛmɛ o kan | 60px ye | 20px ye |
Display belebeleba | 1200px ani ka tɛmɛ o kan | 70px ye | 30px ye |
Walasa ka a jira ko minɛnw bɛ jaabi ɲɛw jira ka ɲɛ, i ka viewport meta tag don a la.
- <meta tɔgɔ = "lajɛyɔrɔ" kɔnɔkow = "bonya=minɛn-bonya, daminɛ-skala=1.0" >
Bootstrap tɛ nin kunnafonidilan ɲininkali ninnu don a yɛrɛma, nka u faamuyali n’u farali ka nɔgɔn kosɛbɛ wa a bɛ sigicogo fitinin de wajibiya. Sugandili damadɔ bɛ aw bolo ka Bootstrap jaabiw don a kɔnɔ:
Mun na i tɛna a don a kɔnɔ dɔrɔn? Tiɲɛ fɔ, fɛn bɛɛ man kan ka kɛ mɔgɔ ye min bɛ se ka jaabi di. Sanni an ka dusu don baarakɛlaw kɔnɔ u ka nin fɛɛrɛ in bɔ yen, an b’a jate ko a ka fisa k’a daminɛ.
- /* Landscape telefɔniw ani duguma */
- @media ( bonyaba : 480px ) { ... } . _
- /* Landscape telefɔni ka portrait tablɛti */
- @media ( bonyaba : 767px ) { ... } . _
- /* Portrait tablɛti ka landscape ani bureau */
- @media ( min bonya : 768px ) ani ( bonyaba : 979px ) { ... } . _ _
- /* Bureau belebele */
- @media ( min - bonya : 1200px ) { ... } .
Walasa ka mobili-friendly yiriwali teliya, baara kɛ ni nin nafama-kalanso jɔnjɔnw ye walasa ka kunnafoniw jira ani k’u dogo minɛnw fɛ.
Baara kɛ ni dan ye ani i kana site kelen in bɔcogo wɛrɛw dilan pewu. O nɔ na, baara kɛ n’u ye walasa ka minɛn kelen-kelen bɛɛ jiracogo dafa.
Misali la, i bɛ se <select>
ka nav yɔrɔ dɔ jira mobili layidu talenw kan, nka i tɛ se ka tablɛtiw walima tabali kan.
A jiralen bɛ yan, an bɛ kalan minnu dɛmɛ ani u nɔfɛkow kunnafonidilan ɲininkali labɛncogo dilen dɔ kan (min tɔgɔ sɛbɛnnen don ni minɛn ye). U bɛ se ka sɔrɔ responsive.less
.
Kilasi | Telefɔniw480px ani a duguma | Furakisɛw767px ani a duguma | Burukina Faso768px ani a sanfɛ |
---|---|---|---|
.visible-phone |
A bɛ ye | Dogolen | Dogolen |
.visible-tablet |
Dogolen | A bɛ ye | Dogolen |
.visible-desktop |
Dogolen | Dogolen | A bɛ ye |
.hidden-phone |
Dogolen | A bɛ ye | A bɛ ye |
.hidden-tablet |
A bɛ ye | Dogolen | A bɛ ye |
.hidden-desktop |
A bɛ ye | A bɛ ye | Dogolen |
I ka navigatɛri bonya caman sɛmɛntiya walima ka a doni minɛn wɛrɛw kan walasa ka sanfɛkalansow kɔrɔbɔ.
Jateminɛ kɛlenw b’a jira ko kalasi bɛ ye i ka sisan filɛlikɛyɔrɔ la.
Yan, taamasiyɛn jɛmanw b’a jira ko kalasi dogolen bɛ i ka sisan jatebɔyɔrɔ la.