Bootstrap bɛ jɔ jaabi 12-kolon grids, layouts ani components kan.
Bootstrap bɛ baara Kɛ ni HTML fɛn dɔw ye ani CSS nafolo minnu bɛ HTML5 doctype baara de wajibiya. Aw k’a don aw ka porozew bɛɛ daminɛ na.
- <!DOCTYPE html> ye
- <html lang = "en" >
- ...
- </html>
Bootstrap bɛ diɲɛ jiracogo jɔnjɔnw, sɛbɛnnikɛcogo ani ɲɔgɔndan kɛcogoyaw sigi sen kan. Kɛrɛnkɛrɛnnenya la, anw:
margin
bɛ a bɔ farikolo kanbackground-color: white;
kan ka ...body
@baseFontFamily
, @baseFontSize
, ani @baseLineHeight
fɛnw ye i n’a fɔ an ka sɛbɛnnikɛlanw@linkColor
ani ka link underlines dɔrɔn de kɛ:hover
O cogoyaw bɛ se ka sɔrɔ scaffolding.less kɔnɔ .
Ni Bootstrap 2 ye, reset bloki kɔrɔ in Bɔra ka Kɛ Normalize.css nafa ye , o ye porozɛ ye min Kɛra Nicolas Gallagher ni Jonathan Neal fɛ min fana bɛ fanga Di HTML5 Boilerplate ma . Hali n’an bɛ Normalize caman Kɛ an ka reset.less kɔnɔ , an ye fɛn dɔw Bɔ kɛrɛnkɛrɛnnenya la Bootstrap kama.
Bootstrap grid system default bɛ baara kɛ ni kulu 12 ye , o bɛ kɛ sababu ye ka 940px bonya minɛn dɔ kɛ ni jaabiw kɛcogo ma daminɛ. Ni CSS filen jaabilen farala a kan, jatebɔlan bɛ ladamu ka kɛ 724px ani 1170px bonya ye ka kɛɲɛ n’i ka jatebɔyɔrɔ ye. 767px filɛlikɛyɔrɔw jukɔrɔ, kuluw bɛ kɛ ji ye ani u bɛ ɲɔgɔn dalajɛ jɔlen na.
Walasa ka kulu fila labɛncogo nɔgɔman sɔrɔ, aw bɛ a da ka kulu .row
hakɛ bɛnnen fara a kan .span*
. Komin nin ye jatebɔlan 12 ye, u kelen-kelen bɛɛ .span*
bɛ o kulu 12 hakɛ dɔ lamini, wa u ka kan ka fara ɲɔgɔn kan tuma bɛɛ fo ka se 12 ma jirisun kelen-kelen bɛɛ la (walima kulu hakɛ min bɛ bangebaga kɔnɔ).
- <div kalasi = "lafiɲɛbɔ" >
- <div kalasi = "span4" > ... </div>
- <div kalasi = "span8" > ... </div>
- </div> ye
Ni an ye nin misali in Di, an bɛ .span4
ni ani .span8
, k’a Kɛ kulu 12 ye k’u bɛɛ lajɛlen Kɛ ani jyɛn dafalen.
Aw bɛ kuluw wuli ka taa kinin fɛ ni .offset*
kalanw ye. Kalanso kelen-kelen bɛɛ bɛ dɔ fara kulu dɔ kininbolo fan kan ni kulu kuuru ye. Misali la, .offset4
a bɛ taa .span4
kulu naani kan.
- <div kalasi = "lafiɲɛbɔ" >
- <div kalasi = "span4" > ... </div>
- <div kalasi = "span3 bɛrɛbɛrɛ2" > ... </div>
- </div> ye
Walasa k’i ka kɔnɔkow nest ni grid default ye, i ka kulu kura .row
ni kulu dɔ fara kulu .span*
dɔ kan min bɛ yen .span*
. Nested rows ka kan ka kɛ ni kuluw kulu ye minnu bɛ fara a bangebaga kuluw hakɛ kan.
- <div kalasi = "lafiɲɛbɔ" >
- <div kalasi = "span9" >
- Nivo 1 kulu
- <div kalasi = "lafiɲɛbɔ" >
- <div kalasi = "span6" > 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 pixelw nɔ na kolonw bonya kama. A bɛ ni jaabi seko kelenw ye i n’a fɔ an ka grid fixe system, o bɛ a to a bɛ se ka kɛ cogo bɛnnen na ka ɲɛsin key screen resolutions ni minɛnw ma.
Aw bɛ jirisun o jirisun kɛ "ji" ye ni aw bɛ fɛn caman Changer .row
ka kɛ .row-fluid
. Kolon kalanw bɛ to u cogo kelen na tigitigi, o b’a to a ka nɔgɔn ka wuli ka bɔ grid fixes ni fluides cɛ.
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span4" > ... </div>
- <div kalasi = "span8" > ... </div>
- </div> ye
A bɛ baara kɛ cogo kelen na ni fixe grid system offsetting ye: ka fara .offset*
koloma o kulu kan ka offset ni o kulu caman ye.
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span4" > ... </div>
- <div kalasi = "span4 bɛrɛbɛrɛ2" > ... </div>
- </div> ye
Fluid grids bɛ baara kɛ ni nesting ye cogo wɛrɛ la: nested level kelen-kelen bɛɛ ka kan ka fara kulu 12 kan. O bɛ Kɛ k’a sababu Kɛ ji-jatebɔlan bɛ baara Kɛ ni kɛmɛsarada la, a tɛ Kɛ ni pixel (piksɛl) ye, walasa ka bonyaw sigi sen kan.
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span12" >
- Jilama 12
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span6" >
- Jilama 6
- <div kalasi = "lajɛ-ji" >
- <div kalasi = "span6" > jimafɛn 6 </div>
- <div kalasi = "span6" > jimafɛn 6 </div>
- </div> ye
- </div> ye
- <div kalasi = "span6" > jimafɛn 6 </div>
- </div> ye
- </div> ye
- </div> ye
A bɛ ɲɔgɔndan jɔlen-bonya (ani a bɛ se ka jaabi) labɛn ni <div class="container">
wajibiyalen dɔrɔn ye.
- <farikolo>
- <div kalasi = "minɛn" >
- ...
- </div> ye
- </farikolo>
Aw bɛ ɲɛ dɔ dabɔ min bɛ kɛ ni kolosinsinnan fila ye ni <div class="container-fluid">
—great for applications and docs.
- <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
CSS jaabilen da i ka poroze kɔnɔ ni meta tag ɲuman ni stylesheet wɛrɛw don <head>
i ka sɛbɛn kɔnɔ. N'i ye Bootstrap labɛn ka Bɔ Customize ɲɛ kan, i ka kan ka meta tag dɔrɔn de Dòn a la.
- <meta tɔgɔ = "lajɛyɔrɔ" kɔnɔkow = "bonya=minɛn-bonya, daminɛ-skala=1.0" >
- <link href = "nafolo/css/bootstrap-jaabi.css" rel = "cogo sɛbɛn" >
Kungolow bɛ wuli!Bootstrap tɛ jaabi-falen-falen-falen-falen-falen-falen-falen-falen-falen-falen-falen-falen-falen-falen-falen-yɔrɔw la nin waati in na bawo fɛn bɛɛ man kan ka jaabi-falen-falen Kɛ. 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ɛ i n’a fɔ a mago bɛ cogo min na.
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 |
---|---|---|---|
Display belebeleba | 1200px ani ka tɛmɛ o kan | 70px ye | 30px ye |
Fɔlɔ | 980px ani ka tɛmɛ o kan | 60px ye | 20px ye |
Ja tablɛtiw | 768px ani a sanfɛ | 42px ye | 20px ye |
Telefɔniw ka taa tablɛtiw la | 767px ani a duguma | Kolonw jilamaw, u bonya jɔlen tɛ | |
Telefɔniw | 480px ani a duguma | Kolonw jilamaw, u bonya jɔlen tɛ |
- /* Bureau belebele */
- @media ( min - bonya : 1200px ) { ... } .
- /* Portrait tablɛti ka landscape ani bureau */
- @media ( min bonya : 768px ) ani ( bonyaba : 979px ) { ... } . _ _
- /* Landscape telefɔni ka portrait tablɛti */
- @media ( bonyaba : 767px ) { ... } . _
- /* Landscape telefɔniw ani duguma */
- @media ( bonyaba : 480px ) { ... } . _
Walasa ka mobili-friendly yiriwali teliya, baara kɛ ni nin nafama-kalanso ninnu ye walasa ka kunnafoniw jira ani k’u dogo minɛnw fɛ. Kalanso minnu bɛ sɔrɔ ani u nɔfɛkow kunnafonidilan ɲininkali labɛncogo dilen dɔ kan (min tɔgɔ sɛbɛnnen don ni minɛn ye) tabali bɛ duguma. U bɛ se ka sɔrɔ responsive.less
.
Kilasi | Telefɔniw767px ani a duguma | Furakisɛw979px ka se 768px ma | Burukina FasoFɔlɔ |
---|---|---|---|
.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 |
Baara kɛ ni dan ye ani ka i yɛrɛ tanga site kelen in bɔcogo wɛrɛw ma pewu. O nɔ na, baara kɛ n’u ye walasa ka minɛn kelen-kelen bɛɛ jiracogo dafa. Nafa minnu bɛ jaabi di, olu man kan ka baara kɛ ni tabali ye, wa o cogo la, u tɛ dɛmɛ.
I ka navigatɛri bonya caman sɛmɛntiya walima ka a doni minɛn wɛrɛw kan walasa ka sanfɛ kalanw 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.