CSS
Global CSS marongero, yakakosha HTML zvinhu zvakashongedzwa uye zvakagadziridzwa nemakirasi akawedzera, uye yepamberi grid system.
Global CSS marongero, yakakosha HTML zvinhu zvakashongedzwa uye zvakagadziridzwa nemakirasi akawedzera, uye yepamberi grid system.
Tora iyo yakaderera pane akakosha zvidimbu zveBootstrap zvivakwa, kusanganisira maitiro edu ekuvandudza, nekukurumidza, kwakasimba webhu kuvandudza.
Bootstrap inoshandisa zvimwe zveHTML zvinhu uye CSS zvivakwa zvinoda kushandiswa kweHTML5 doctype. Isanganise pakutanga kwemapurojekiti ako ese.
NeBootstrap 2, isu takawedzera sarudzo dzenhare dzehushamwari dzezvinhu zvakakosha zvechimiro. NeBootstrap 3, takanyora purojekiti kuti ive inoshamwaridzana kubva pakutanga. Panzvimbo pekuwedzera pane sarudzo dzenharembozha, dzakabikwa mukati chaimo. Muchokwadi , Bootstrap inhare yekutanga . Nharembozha yekutanga masitaera anogona kuwanikwa muraibhurari yese panzvimbo yemafaira akasiyana.
Kuti uve nechokwadi chekupa uye kubata kuswedera, wedzera iyo yekutarisa meta tag kune yako <head>
.
Iwe unogona kudzima kugona kwekusimudzira pane nharembozha nekuwedzera user-scalable=no
kune yekuona meta tag. Izvi zvinomisa kuswedera, zvichireva kuti vashandisi vanokwanisa chete kupururudza, uye zvinokonzeresa kuti saiti yako inzwe zvishoma senge application yemuno. Pakazara, isu hatikurudzire izvi pane yega saiti, saka chenjera!
Bootstrap inoseta kuratidzwa kwepasirese, kutaipa, uye mataira ekubatanidza. Kunyanya, isu:
background-color: #fff;
pabody
@font-family-base
, @font-size-base
, uye @line-height-base
hunhu seyedu typographic base@link-color
uye shandisa chinongedzo pasi pemutsara chete pa:hover
Aya masitayera anogona kuwanikwa mukati scaffolding.less
.
Kuvandudza mashandisirwo ebrowser, tinoshandisa Normalize.css , chirongwa chakaitwa naNicolas Gallagher naJonathan Neal .
Bootstrap inoda chinhu chine chinhu chekuputira zviri mukati mesaiti uye imba yedu grid system. Unogona kusarudza imwe yemidziyo miviri yekushandisa mumapurojekiti ako. Ziva kuti, nekuda padding
uye nezvimwe, hapana mudziyo haugone.
Shandisa .container
kune inopindura yakagadziriswa yakafara mudziyo.
Shandisa .container-fluid
kune yakazara hupamhi chigaba, chinotenderera hupamhi hwese hwekutarisa kwako.
Bootstrap inosanganisira inopindura, mobile first fluid grid system iyo inoyera zvakakodzera kusvika kumakoramu gumi nemaviri sezvo mudziyo kana saizi yekuona inowedzera. Inosanganisira makirasi akafanotsanangurwa esarudzo dzakareruka dzekuronga, pamwe nemisanganiswa ine simba yekugadzira mamwe semantic marongero .
Grid masisitimu anoshandiswa kugadzira marongero epeji kuburikidza nenhevedzano yemitsara nemakoramu anoisa zvirimo zvako. Heino mashandiro anoita Bootstrap grid system:
.container
(yakagadziriswa-hupamhi) kana .container-fluid
(yakazara-hupamhi) kuitira kurongeka kwakakodzera uye padding..row
uye .col-xs-4
anowanikwa nekukurumidza kugadzira grid marongero. Mashoma musanganiswa anogona zvakare kushandiswa kune mamwe semantic marongero.padding
. Iyo padding inogadziriswa mumitsara yekutanga uye yekupedzisira koramu kuburikidza neasina kunaka margin pane .row
s..col-xs-4
..col-md-*
kirasi kune chimwe chinhu hakuzongokanganisa masitayipi ayo pamidziyo yepakati asiwo pamidziyo mikuru kana .col-lg-*
kirasi isipo.Tarisa kumienzaniso yekushandisa misimboti iyi kukodhi yako.
Isu tinoshandisa inotevera midhiya mibvunzo mumafaira edu Mashoma kugadzira makiyi ekutyora mugidhi system.
Isu tinombowedzera pane iyi midhiya mibvunzo kuti ibatanidze a max-width
yekumisa CSS kune yakamanikana seti yemidziyo.
Ona maitiro eBootstrap grid system anoshanda pane akawanda maturusi ane tafura inoshanda.
Midziyo midiki yakawedzera Mafoni (<768px) | Midziyo midiki Mahwendefa (≥768px) | Desktop dzemidziyo yepakati ( ≥992px ) | Midziyo mikuru Desktops (≥1200px) | |
---|---|---|---|---|
Grid maitiro | Horizontal nguva dzose | Yakapetwa kuti itange, yakachinjika pamusoro pemabreakpoint | ||
Container yakafara | Hapana (otomatiki) | 750px | 970px | 1170px |
Chivakashure chekirasi | .col-xs- |
.col-sm- |
.col-md- |
.col-lg- |
# yembiru | 12 | |||
Column width | Auto | ~62px | ~81px | ~97px |
Gutter width | 30px (15px kudivi rega rega rekoramu) | |||
Nestable | Ehe | |||
Offsets | Ehe | |||
Column kuronga | Ehe |
Uchishandisa seti imwe chete .col-md-*
yemakirasi egidhi, unogona kugadzira yakakosha grid sisitimu iyo inotanga yakaturikidzana panhare mbozha uye mahwendefa emidziyo (iyo yakawedzera diki kusvika kudiki renji) isati yave yakachinjika padesktop (yepakati) zvishandiso. Isa grid column mune chero .row
.
Shandura chero yakagadzika-hupamhi yegridi dhizaini kuita yakazara-hupamhi dhizaini nekushandura yako yekunze .container
kuti .container-fluid
.
Haudi kuti makoramu ako angomira mumidziyo midiki? Shandisa iyo yakawedzera diki uye yepakati mudziyo grid makirasi nekuwedzera kumakoramu .col-xs-*
.col-md-*
ako. Ona muenzaniso pazasi kuti uwane zano riri nani rekuti zvese zvinoshanda sei.
Vaka pamuenzaniso wekare nekugadzira zvakatowanda uye zvine simba marongero ane .col-sm-*
makirasi ehwendefa.
Kana makoramu anopfuura gumi nemaviri akaiswa mukati memutsara mumwe chete, boka rega rega remamwe makoramu, sechikamu chimwe, richaputira pamutsetse mutsva.
Nematanho mana emagidhi aripo iwe unosungirwa kumhanya mumatambudziko apo, pane mamwe mabreakpoints, makoramu ako haanyatso kujeka sezvo imwe yakareba kupfuura imwe. Kugadzirisa izvo, shandisa musanganiswa wea .clearfix
uye yedu inopindura zvekushandisa makirasi .
Pamusoro pekuchenesa makoramu panzvimbo dzinoteerera, ungangoda kuseta patsva, zvinosundidzira, kana kudhonza . Ona izvi muchiito mumuenzaniso wegridi .
Fambisa makoramu kurudyi uchishandisa .col-md-offset-*
makirasi. Aya makirasi anowedzera kumucheto kwekuruboshwe kwekoramu *
nemakoramu. Semuenzaniso, .col-md-offset-4
inofamba .col-md-4
pamusoro pemakoramu mana.
Iwe unogona zvakare kudarika offsets kubva pasi regidhi tiers .col-*-offset-0
nemakirasi.
Kuti uise zvirimo zvako neiyo default grid, wedzera nyowani .row
uye seti .col-sm-*
yemakoramu mukati meiyo iripo .col-sm-*
column. Mitsara yakamira inofanira kusanganisira seti yemakoramu anowedzera kusvika gumi nemaviri kana mashoma (hazvidiwi kuti ushandise makoramu gumi nemaviri aripo).
Shandura zviri nyore kurongeka kwemakoramu edu akavakirwa-mukati megidhi .col-md-push-*
nemakirasi .col-md-pull-*
ekugadzirisa.
Pamusoro pemakirasi egidhi akavakwa ekukurumidza masisitimu, Bootstrap inosanganisira Mashoma machinjiro uye musanganiswa wekukurumidza kugadzira yako yakapusa, semantic marongero.
Zvinosiyana-siyana zvinotarisa huwandu hwemakoramu, hupamhi hweguta, uye nzvimbo yekubvunza midhiya panotangira makoramu anoyangarara. Isu tinoshandisa izvi kugadzira iyo yakafanotsanangurwa makirasi egidhi akanyorwa pamusoro, pamwe neyetsika musanganiswa akanyorwa pazasi.
Mixins anoshandiswa pamwe chete negridhi zvinosiyana kugadzira semantic CSS yemakoramu ega ega.
Iwe unogona kushandura mavhezheni kune ako ega tsika tsika, kana kungo shandisa mamixins ane maitiro avo akasarudzika. Heino muenzaniso wekushandisa zvigadziriso zvekutanga kugadzira maviri-column marongero ane gap pakati.
Yese misoro yeHTML, <h1>
kuburikidza ne <h6>
, iripo. .h1
kuburikidza .h6
nemakirasi anowanikwawo, nekuti kana iwe uchida kufananidza manyorerwo efonti yemusoro asi uchiri kuda kuti chinyorwa chako chiratidzwe mukati.
h1. Bootstrap musoro |
Semibold 36px |
h2. Bootstrap musoro |
Semibold 30px |
h3. Bootstrap musoro |
Semibold 24px |
h4. Bootstrap musoro |
Semibold 18px |
h5. Bootstrap musoro |
Semibold 14px |
h6. Bootstrap musoro |
Semibold 12px |
Gadzira mavara akareruka, echipiri mune chero musoro une jenari <small>
tag kana .small
kirasi.
h1. Bootstrap musoro Chinyorwa chechipiri |
h2. Bootstrap musoro Chinyorwa chechipiri |
h3. Bootstrap musoro Chinyorwa chechipiri |
h4. Bootstrap musoro Chinyorwa chechipiri |
h5. Bootstrap musoro Chinyorwa chechipiri |
h6. Bootstrap musoro Chinyorwa chechipiri |
Bootstrap's global default font-size
ndeye 14px , ine line-height
ye1.428 . Izvi zvinoshandiswa kune <body>
uye ndima dzese. Uye zvakare, <p>
(ndima) inogashira muganho wepazasi wehafu yavo computed mutsara-urefu (10px nekusarudzika).
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.
Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
Ita kuti ndima ibude pachena nekuwedzera .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
Chikero chetaipi chinobva pane zviviri Zvidiki zvitsauko muzvinyorwa.zvishoma : @font-size-base
uye @line-height-base
. Yekutanga ndiyo base font-saizi inoshandiswa mukati mese uye yechipiri ndiyo base mutsetse-urefu. Isu tinoshandisa iwo akasiyana uye mamwe masvomhu akareruka kugadzira miganho, padding, uye mutsara-urefu hwemhando yedu yese nezvimwe. Gadzirisa ivo uye Bootstrap inogadzirisa.
Kuti utarise kumhanya kwemavara nekuda kwekukosha kwaro mune imwe mamiriro, shandisa iyo <mark>
tag.
Unogona kushandisa mamaki tag kuhighlighttext.
Pakuratidza ma blocks emavara akadzimwa shandisa <del>
tag.
Mutsetse wemavara uyu unofanirwa kubatwa semavara akadzimwa.
Pakuratidza mabhuroko emavara asingachashandi shandisa <s>
tag.
Mutsara wechinyorwa uyu unoitirwa kuti utorerwe seusisina chokwadi.
Pakuratidza kuwedzera kugwaro shandisa <ins>
tag.
Mutsara wechinyorwa uyu unofanirwa kubatwa sewedzero kugwaro.
Kunyora pasi pasi shandisa <u>
tag.
Mutsara wemavara uyu unozopa sekunyorwa kwazvakaitwa
Shandisa HTML's default emphasis tag ane huremu zvitaera.
Kuti usasimbise mukati kana mabhuroko ezvinyorwa, shandisa <small>
tag kuseta mavara pa85% saizi yemubereki. Maelement emusoro anogashira ega font-size
ezvimedu zvematendere <small>
.
Iwe unogona neimwe nzira kushandisa inline element .small
pachinzvimbo chechero <small>
.
Mutsara wechinyorwa uyu unoitirwa kubatwa sechinyorwa chakanaka.
Zvekusimbisa chidimbu chemavara ane huremu hwefonti-huremu.
Chidimbu chinotevera chemavara chinoshandurwa semavara matema .
Zvekusimbisa chidimbu chemavara nemavara akatsveyama.
Chidimbu chinotevera chemavara chinoshandurwa semavara akatsveyamiswa .
Inzwa wakasununguka kushandisa <b>
uye <i>
muHTML5. <b>
inoitirwa kuratidza mazwi kana mitsara pasina kuendesa kukosha kwekuwedzera asi <i>
kazhinji iri yezwi, tekinoroji mazwi, nezvimwe.
Gadzirisa zvinyorwa kune zvikamu zvine makirasi ekugadzirisa zvinyorwa.
Mashoko akarocherwa kuruboshwe.
Mavara akarongedzerwa nepakati.
Mavara anoenderana nekurudyi.
Rugwaro rwakarurama.
Hapana chinyorwa chekupeta.
Shandura zvinyorwa muzvikamu zvine makirasi emavara makuru.
Mavara akaderedzwa.
Mavara makuru.
Mavara makuru.
Kuitwa kwakamisikidzwa kweHTML's <abbr>
element yekupfupisa uye acronyms kuratidza yakawedzera vhezheni pane hover. Madimburiko ane title
hunhu ane mwenje wepasi muganho uye cherubatsiro pane hover, ichipa mamwe mamiriro pane hover uye kune vashandisi veanobatsira matekinoroji.
Muchidimbu chezwi rokuti attr .
Wedzera .initialism
kuchidimbu chemavara madiki zvishoma.
HTML ndicho chinhu chakanakisa kubva pachingwa chakachekwa.
Ipa ruzivo rwekufonera kumadzitateguru ari pedyo kana boka rose rebasa. Chengetedza fomati nekugumisa mitsetse yese ne <br>
.
Zvekutora zvivharo zvemukati kubva kune imwe sosi mukati megwaro rako.
Putira <blockquote>
kutenderedza chero HTML se quote. Kuti uwane mazwi akatwasuka, tinokurudzira a <p>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante.
Chimiro uye zvirimo zvinoshanduka kuti zvive nyore kusiyanisa pachiyero <blockquote>
.
Wedzera a <footer>
yekuziva kwakabva. Peta zita rekwakabva basa mu <cite>
.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat ante.
Wedzera .blockquote-reverse
kune blockquote ine zvakamisikidzwa-kurudyi zvemukati.
Rondedzero yezvinhu umo kurongeka kusina basa zvakajeka.
Rondedzero yezvinhu umo kurongeka kunokosha zvakajeka.
Bvisa iyo yakasarudzika list-style
uye yekuruboshwe muganho pane rondedzero zvinhu (pakarepo vana chete). Izvi zvinongoshanda kune ipapo vana rondedzero zvinhu , zvichireva kuti iwe uchafanirwa kuwedzera kirasi kune chero rondedzero yakanyorwa zvakare.
Isa zvinhu zvese zvakarongwa pamutsara mumwe une display: inline-block;
uye mamwe mapedhi akareruka.
Rondedzero yematemu ane tsananguro dzawo.
Ita mazwi uye tsananguro mumutsara <dl>
wakatarisana-ne-parutivi. Inotanga kurongedzerwa senge default <dl>
s, asi kana iyo navbar ikawedzera, ita izvi.
Tsanangudzo dzakachinjika dzichadimbura mazwi akareba zvekusakwana muchikamu chekuruboshwe ne text-overflow
. Munzvimbo dzakatetepa dzekutarisa, ivo vanozochinja kune default stacked marongero.
Putira zvidimbu zvidimbu zvekodhi ne<code>
.
<section>
inofanira kuputirwa se inline.
Shandisa iyo<kbd>
kuratidza yekuisa iyo inowanzo pinda nekhibhodi.
Shandisa <pre>
kune akawanda mitsara yekodhi. Ita shuwa kutiza mabhuraketi chero emakona ari mukodhi kuti ukwanise kuburitsa.
<p>Eyemuenzaniso mavara pano...</p>
Iwe unogona kusarudza kuwedzera .pre-scrollable
kirasi, iyo inoisa max-urefu hwe350px uye inopa y-axis scrollbar.
Pakuratidza zvinoshanduka shandisa <var>
tag.
y = m x + b
Kuratidza mabhuroki emuenzaniso kubuda kubva kuchirongwa shandisa iyo <samp>
tag.
Ichi chinyorwa chinofanirwa kubatwa semuenzaniso wekubuda kubva kuchirongwa chekombuta.
Kune ekutanga masitaera - mwenje padding uye chete yakachinjika dividers - wedzera base kirasi .table
kune chero <table>
. Zvinogona kuratidzika sezvisina basa, asi nekushandiswa kwakapararira kwematafura kune mamwe maplugins senge makarenda uye vanotora mazuva, isu takasarudza kuparadzanisa yedu tsika tafura masitayipi.
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry | Shiri |
Shandisa .table-striped
kuwedzera zebra-striping kune chero mutsara wetafura mukati me <tbody>
.
Matafura ane mitsetse akanyorwa kuburikidza :nth-child
neCSS selector, iyo isingawanikwe muInternet Explorer 8.
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry | Shiri |
Wedzera .table-bordered
kune miganhu kumativi ese etafura uye maseru.
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry | Shiri |
Wedzera .table-hover
kugonesa hover state patafura mitsara mukati me <tbody>
.
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry | Shiri |
Wedzera .table-condensed
kuita kuti matafura awedzere kuwirirana nekucheka cell padding nepakati.
# | Zita rokutanga | Zita rokupedzisa | Username |
---|---|---|---|
1 | Mark | Otto | @mdo |
2 | Jacob | Thornton | @mafuta |
3 | Larry the Shiri |
Shandisa makirasi emukati kupenda mitsara yematafura kana maseru ega ega.
Kirasi | Tsanangudzo |
---|---|
.active |
Isa ruvara rwehovha kune imwe mutsara kana sero |
.success |
Zvinoratidza chiito chakabudirira kana chakanaka |
.info |
Inoratidza shanduko yeruzivo rwakarerekera kana chiito |
.warning |
Inoratidza yambiro ingada kutariswa |
.danger |
Zvinoratidza chiitiko chine njodzi kana chingangove chakaipa |
# | Musoro wechikamu | Musoro wechikamu | Musoro wechikamu |
---|---|---|---|
1 | Column content | Column content | Column content |
2 | Column content | Column content | Column content |
3 | Column content | Column content | Column content |
4 | Column content | Column content | Column content |
5 | Column content | Column content | Column content |
6 | Column content | Column content | Column content |
7 | Column content | Column content | Column content |
8 | Column content | Column content | Column content |
9 | Column content | Column content | Column content |
Kushandisa ruvara kuwedzera zvazvinoreva kumutsara wetafura kana sero rega rega kunongopa chiratidzo chekuona, icho chisingazopirwe kune vashandisi vetekinoroji yekubatsira - senge screen readers. Ita shuwa kuti ruzivo rwunoratidzwa neruvara rwuri pachena kubva pane zvirimo (zvinyorwa zvinooneka mumutsara wetafura yakakodzera / sero), kana kuti inosanganisirwa neimwe nzira, senge mamwe mavara akavanzwa .sr-only
nekirasi.
Gadzira matafura anopindura nekuputira chero .table
mukati .table-responsive
kuti afambe akachinjika pamidziyo midiki (pasi pe768px). Kana uchiona pane chero chinhu chakakura kudarika 768px yakafara, hauzooni chero mutsauko mumatafura aya.
Matafura anopindura anoshandisa overflow-y: hidden
, ayo anobvisa chero zvirimo zvinodarika kuzasi kana kumucheto kwetafura. Kunyanya, izvi zvinogona kudimbura mamenu ekudonha uye mamwe echitatu-bato majeti.
Firefox ine mamwe maitiro asina kunaka emumunda anosanganisira width
anovhiringa tafura inopindura. Izvi hazvigone kudhindwa pasina Firefox-chaiyo hack yatisingape muBootstrap :
Kuti uwane rumwe ruzivo, verenga iyi Stack Overflow mhinduro .
# | Musoro wetafura | Musoro wetafura | Musoro wetafura | Musoro wetafura | Musoro wetafura | Musoro wetafura |
---|---|---|---|---|---|---|
1 | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell |
2 | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell |
3 | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell |
# | Musoro wetafura | Musoro wetafura | Musoro wetafura | Musoro wetafura | Musoro wetafura | Musoro wetafura |
---|---|---|---|---|---|---|
1 | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell |
2 | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell |
3 | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell | Tafura cell |
Mafomu ega ega anodzora anogamuchira otomatiki mamwe masitaera epasirese. Zvese zvinyorwa <input>
, <textarea>
, uye <select>
zvinhu zvine .form-control
zvinomisikidzwa kune width: 100%;
default. Putira mavara uye zvidzoreso mukati .form-group
kuitira nzvimbo yakakwana.
Usasanganise mafomu mapoka zvakananga nemapoka ekuisa . Pane kudaro, isa boka rekuisa mukati meboka refomu.
Wedzera kufomu .form-inline
yako (isingafanirwe kunge iri <form>
) yeakatarisana nekuruboshwe uye inline-block zvinodzora. Izvi zvinongoshanda kune mafomu ari mukati mekuona nzvimbo dzinenge 768px yakafara.
Zvinopinza uye width: 100%;
zvakasarudzwa zvakashandiswa nekusingaperi muBootstrap. Mukati memafomu emukati, isu tinoisa zvakare kuti kune width: auto;
akawanda ma controls anogona kugara pamutsetse mumwe chete. Zvichienderana nemagadzirirwo ako, humwe hupamhi hwetsika hunogona kudiwa.
Vaverengi veScreen vanozonetseka nemafomu ako kana ukasabatanidza label yeese mapikisi. Kune aya mafomu emukati, unogona kuvanza mavara uchishandisa .sr-only
kirasi. Kune dzimwe nzira dzekupa label yekubatsira matekinoroji, senge aria-label
, aria-labelledby
kana title
hunhu. Kana pasina chimwe cheizvi chiripo, vaverengi vescreen vanogona kushandisa placeholder
hunhu, kana huripo, asi cherechedza kuti kushandiswa placeholder
kwechinzvimbo chedzimwe nzira dzekunyora hakuna kurairwa.
Shandisa Bootstrap's predefined grid makirasi kurongedza mavara uye mapoka emafomu ekudzora mune yakachinjika marongero nekuwedzera .form-horizontal
kune fomu (iro risingafanirwe kunge riri <form>
). Kuita kudaro kunochinja .form-group
s kuita segridi mitsara, saka hapana chikonzero che .row
.
Mienzaniso yezvidzoreso zvefomu zvakajairwa zvinotsigirwa muchimiro chechimiro chechimiro.
Mazhinji mafomu ekutonga, mavara-akavakirwa ekuisa ndima. Inosanganisira rutsigiro rwemhando dzese dzeHTML5: text
, password
, datetime
, datetime-local
, date
, month
, time
, week
, number
, email
, url
, search
, tel
, uye color
.
Zvinopinza zvichange zvakazara chete kana yavo type
yakaziviswa nemazvo.
Kuti uwedzere mavara akasanganiswa kana mabhatani pamberi uye/kana mushure mechero mavara-based <input>
, tarisa chikamu cheboka rekupinda .
Form control inotsigira mitsetse yakawanda yemavara. Chinja rows
hunhu sezvinodiwa.
Mabhokisi ekutarisa ndeekusarudza imwe kana akati wandei sarudzo mune runyorwa, nepo maredhiyo ari ekusarudza imwe sarudzo kubva kune akawanda.
Mabhokisi ekutarisa akaremara neredhiyo zvinotsigirwa, asi kuti upe "zvisingabvumirwe" cursor pane hover yemubereki <label>
, unozofanira kuwedzera .disabled
kirasi kumubereki .radio
, .radio-inline
, .checkbox
, kana .checkbox-inline
.
Shandisa iyo .checkbox-inline
kana .radio-inline
makirasi panhevedzano yemabhokisi ekutarisa kana maredhiyo kune zvinodzora zvinoonekwa pamutsetse mumwe chete.
Kana iwe usina mavara mukati meiyo <label>
, iyo inoiswa yakaiswa sezvaungatarisira. Parizvino inoshanda chete pane asiri-inline cheki mabhokisi nemaredhiyo. Rangarira uchiri kupa imwe fomu yelabel yekubatsira matekinoroji (semuenzaniso, kushandisa aria-label
).
Ziva kuti mazhinji emamenu akasarudzika - ari muSafari uye Chrome - ane makona akatenderedzwa asingagone kugadziridzwa kuburikidza border-radius
nezvivakwa.
Kune <select>
zvidzoreso zvine multiple
hunhu, sarudzo dzakawanda dzinoratidzwa nekusingaperi.
Paunenge uchida kuisa mavara akajeka pedyo nepepa refomu mukati mefomu, shandisa .form-control-static
kirasi pa <p>
.
Isu tinobvisa masitaera ekutanga outline
pane mamwe mafomu ekutonga uye toisa a box-shadow
panzvimbo yayo ye :focus
.
:focus
stateMuenzaniso uri pamusoro apa unoshandisa masitaira echinyakare muzvinyorwa zvedu kuratidza :focus
nyika pane .form-control
.
Wedzera iyo disabled
boolean hunhu pane inopinza kudzivirira kusangana kwevashandisi. Mamepu akaremara anoita seakareruka uye not-allowed
owedzera chitubu.
Wedzera disabled
hunhu kune a <fieldset>
kudzima zvese zvinodzora mukati menguva imwe <fieldset>
chete.
<a>
Nekumisikidza, mabhurawuza anobata ese ekuzvarwa mafomu ekutonga ( <input>
, <select>
uye <button>
zvinhu) mukati <fieldset disabled>
seakaremara, kudzivirira zvese zviri zviviri keyboard uye mbeva kupindirana pazviri. Nekudaro, kana fomu rako richisanganisira <a ... class="btn btn-*">
zvinhu, izvi zvinongopihwa maitiro e pointer-events: none
. Sezvacherechedzwa muchikamu nezve yakaremara nyika yemabhatani (uye kunyanya muchikamu chidiki chezvibatiso), ichi CSS chivakwa hachisati chamira uye hachina kutsigirwa zvizere muOpera 18 nepasi, kana muInternet Explorer 11, uye yakahwina. 'Kudzivirira vashandisi vekhibhodi kuti vakwanise kutarisa kana kumisa aya malink. Saka kuti uve wakachengeteka, shandisa tsika JavaScript kudzima zvinongedzo zvakadaro.
Nepo Bootstrap ichizoshandisa masitaera aya mumabhurawuza ese, Internet Explorer 11 uye pazasi haitsigire zvizere disabled
hunhu pane <fieldset>
. Shandisa JavaScript yakajairwa kudzima iyo fieldset mumabrowser aya.
Wedzera iyo readonly
boolean hunhu pane inopinza kudzivirira kugadziridzwa kweiyo kukosha kwekuisa. Zvekuverenga-chete zvinowoneka zvakareruka (sezvakangoita zvakadzimwa), asi chengetedza chiyero chekare.
Mameseji erubatsiro eBlock level yezvidzoro zvefomu.
Rubatsiro runofanira kuenderana nefomu rekutonga rine chekuita nekushandisa aria-describedby
hunhu. Izvi zvinova nechokwadi chekuti tekinoroji dzekubatsira - senge zvidzitiro zvekuverenga - zvichazivisa chinyorwa ichi chekubatsira kana mushandisi akatarisa kana kupinda mukutonga.
Bootstrap inosanganisira yekusimbisa masitaera yekukanganisa, yambiro, uye budiriro nyika pamafomu ekudzora. Kushandisa, kuwedzera .has-warning
, .has-error
, kana .has-success
kune chinhu chemubereki. Chero .control-label
, .form-control
, uye .help-block
mukati mechinhu ichocho chinogashira masitaera ekusimbisa.
Kushandisa aya masitayipi ekusimbisa kuratidza mamiriro echimiro chekutonga kunongopa chinooneka, chine ruvara-chakavakirwa chiratidzo, icho chisingazopirwe kune vashandisi veanobatsira matekinoroji - akadai semascreen readers - kana kune colorblind vashandisi.
Ita shuwa kuti imwe nzira inoratidza nyika yapihwa zvakare. Semuyenzaniso, unogona kubatanidza ratidziro pamusoro penyika mugwaro rekutonga (sezvazviri mumuenzaniso <label>
unotevera wekodhi), sanganisira Glyphicon (ine mamwe mavara akakodzera uchishandisa .sr-only
kirasi - ona mienzaniso yeGlyphicon ), kana nekupa kuwedzera rubatsiro text block. Kunyanya kune anobatsira matekinoroji, zvisizvo fomu zvidzoreso zvinogona zvakare kupihwa aria-invalid="true"
hunhu.
Iwe unogona zvakare kuwedzera sarudzo yemhinduro icons nekuwedzera kwe.has-feedback
uye neiyo icon chaiyo.
Feedback icons inoshanda chete nezvinyorwa <input class="form-control">
zvinyorwa.
Kumisikidzwa nemaoko kwezvidhori zvemhinduro kunodiwa pakuisa pasina zita uye kumapoka ekuisa ane akawedzera kurudyi. Iwe unokurudzirwa zvakanyanya kuti upe mavara ezvese zvinopinda nekuda kwezvikonzero zvekuwanikwa. Kana uchida kudzivirira mavara kuti asaonekwe, avige .sr-only
nekirasi. Kana iwe uchifanira kuita pasina mavara, gadzirisa top
kukosha kweiyo mhinduro icon. Kune mapoka ekuisa, gadzirisa right
kukosha kune yakakodzera pixel kukosha zvichienderana nehupamhi hweaddon yako.
Kuti ive nechokwadi chekuti tekinoroji dzekubatsira - senge zviverengero zvemasikirini - dzinoburitsa zvinorehwa nechiratidzo, mamwe mavara akavanzika anofanirwa kuverengerwa .sr-only
nekirasi uye anonyatso kudyidzana nefomu rekutonga rine chekuita nekushandisa aria-describedby
. Neimwe nzira, ita shuwa kuti zvinorehwa (semuenzaniso, chokwadi chekuti pane yambiro yeimwe ndima yekupinda zvinyorwa) zvinounzwa mune imwe nzira, sekushandura zvinyorwa zveiyo chaiyo.<label>
inobatana nekutonga fomu.
Kunyangwe iyo inotevera mienzaniso yatotaura nezve kusimbiswa kwechimiro chemaitiro avo ekutonga <label>
mugwaro pacharo, nzira iri pamusoro (kushandisa .sr-only
chinyorwa uye aria-describedby
) yakaverengerwa zvinangwa zvemifananidzo.
.sr-only
mavara akavanzikaKana iwe ukashandisa .sr-only
kirasi kuvanza fomu rekutonga's <label>
(pane kushandisa dzimwe sarudzo dzekunyora, senge aria-label
hunhu), Bootstrap inogadzirisa otomatiki chinzvimbo cheiyo icon kana yawedzerwa.
Seta hurefu uchishandisa makirasi akafanana .input-lg
, uye isa hupamhi uchishandisa grid column makirasi senge .col-lg-*
.
Gadzira marefu kana mapfupi emafomu ekutonga anoenderana nemabhatani saizi.
Kurumidza saizi mavara uye fomu zvidzoreso mukati .form-horizontal
nekuwedzera .form-group-lg
kana .form-group-sm
.
Putira zvinopinza mumakoramu egidhi, kana chero tsika yevabereki chinhu, kumanikidza zviri nyore upamhi hunodiwa.
Shandisa mabhatani makirasi pane<a>
, <button>
, kana <input>
chinhu.
Nepo mabhatani makirasi anogona kushandiswa <a>
uye <button>
zvinhu, <button>
zvinhu chete zvinotsigirwa mukati menav uye navbar zvikamu.
Kana izvo <a>
zvinhu zvakashandiswa kuita semabhatani - zvichikonzera mukati-peji kushanda, pane kuenda kune rimwe gwaro kana chikamu mukati meiyo peji peji - ivo vanofanirwawo kupihwa yakakodzera role="button"
.
Sekuita kwakanakisa, isu tinokurudzira zvikuru kushandisa <button>
chinhu pese pazvinogoneka kuve nechokwadi chekufananidza muchinjika-browser rendering.
Pakati pezvimwe zvinhu, pane bug muFirefox <30 inotitadzisa kuseta mabhatani line-height
e <input>
--based, zvichiita kuti asanyatsoenderana nehurefu hwemamwe mabhatani paFirefox.
Shandisa chero anowanikwa mabhatani makirasi kukurumidza kugadzira bhatani rakanyorwa.
Kushandisa ruvara kuwedzera chirevo kubhatani kunongopa chiratidzo chekuona, icho chisingazopirwe kune vashandisi vetekinoroji yekubatsira - senge mascreen readers. Ita shuwa kuti ruzivo rwunoratidzwa neruvara rwuri pachena kubva kune zvirimo pachayo (zvinyorwa zvinooneka zvebhatani), kana kuti zvinosanganisirwa neimwe nzira, senge mamwe mavara akavanzwa .sr-only
nekirasi.
Unoda mabhatani makuru kana madiki? Wedzera .btn-lg
, .btn-sm
, kana .btn-xs
mamwe masaizi.
Gadzira mabhatani e block level — ayo anotambanudzira upamhi hwakazara hwemubereki — nekuwedzera .btn-block
.
Mabhatani anozoonekwa akadzvanywa (aine yakasviba kumashure, yakasviba muganho, uye inset mumvuri) kana ichishanda. Nezvezvinhu <button>
, izvi zvinoitwa kuburikidza ne :active
. Nezvezvinhu <a>
, zvinoitwa ne .active
. Nekudaro, iwe unogona kushandisa .active
pa <button>
s (uye sanganisira aria-pressed="true"
hunhu) kana iwe uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchinge uchingerwa mamiriro ehurongwa.
Hapana chikonzero chekuwedzera :active
sezvo iri pseudo-kirasi, asi kana iwe uchida kumanikidza chitarisiko chimwe chete, enda mberi uwedzere .active
.
Wedzera .active
kirasi <a>
kumabhatani.
Ita kuti mabhatani aite seasingabatike nekuadzima neshure ne opacity
.
Wedzera disabled
hunhu <button>
kumabhatani.
Kana iwe ukawedzera disabled
hunhu ku <button>
, Internet Explorer 9 uye pazasi ichapa mavara grey ane akashata mavara-mumvuri watisingakwanise kugadzirisa.
Wedzera .disabled
kirasi <a>
kumabhatani.
Isu tinoshandisa .disabled
sekirasi yekushandisa pano, yakafanana .active
nekirasi yakajairika, saka hapana prefix inodiwa.
Kirasi iyi inoshandisa pointer-events: none
kuyedza kudzima mashandiro ekubatanidza kwe <a>
s, asi iyo CSS pfuma haisati yamira uye haisati yanyatso kutsigirwa muOpera 18 nepasi, kana muInternet Explorer 11. Pamusoro pezvo, kunyangwe mumabhurawuza anotsigira pointer-events: none
, keyboard. kufamba kunoramba kusingakanganisike, zvichireva kuti vanoona vashandisi vekhibhodi nevashandisi veanobatsira matekinoroji vachakwanisa kumisa aya malink. Saka kuti uve wakachengeteka, shandisa tsika JavaScript kudzima zvinongedzo zvakadaro.
Mifananidzo muBootstrap 3 inogona kuitwa inopindura-inoshamwaridzika kuburikidza nekuwedzera .img-responsive
kwekirasi. Izvi zvinoshanda max-width: 100%;
, height: auto;
uye display: block;
kumufananidzo kuitira kuti ukwire zvakanaka kune chinhu chemubereki.
Kuisa pakati mifananidzo inoshandisa .img-responsive
kirasi, shandisa .center-block
pachinzvimbo che .text-center
. Ona chikamu chezvidzidzo zvevabatsiri kuti uwane rumwe ruzivo nezve .center-block
mashandisiro.
MuInternet Explorer 8-10, mifananidzo yeSVG ine .img-responsive
yakakura zvisina mwero. Kugadzirisa izvi, wedzera width: 100% \9;
pazvinenge zvakakodzera. Bootstrap haishandise izvi otomatiki sezvo zvichikonzera matambudziko kune mamwe mafomati emifananidzo.
Wedzera makirasi kune <img>
chinhu kuti zvive nyore kutaira mifananidzo mune chero chirongwa.
Ramba uchifunga kuti Internet Explorer 8 haina tsigiro yemakona akatenderedzwa.
Taurira zvinorehwa kuburikidza neruvara uine mashoma emakirasi ekusimbisa ekushandisa. Izvi zvinogona zvakare kuiswa kune zvinongedzo uye zvichasviba pane hover senge yedu default link masitayipi.
Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.
Nullam id id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Dzimwe nguva makirasi ekusimbisa haagone kushandiswa nekuda kwekutsanangurwa kweimwe sarudzo. Muzviitiko zvakawanda, yakakwana workaround ndeyekuputira chinyorwa chako mune <span>
nekirasi.
Kushandisa ruvara kuwedzera zvinoreva kunongopa chiratidzo chekuona, icho chisingazopirwe kune vashandisi vetekinoroji yekubatsira - senge zvidzitiro zvekuverenga. Ita shuwa kuti ruzivo rwunoratidzwa nemuvara rwuri pachena kubva pane zviri mukati (mavara emukati anongoshandiswa kusimbisa zvinoreva izvo zvatovepo muzvinyorwa / mucherechedzo), kana inosanganisirwa neimwe nzira, senge mamwe mavara akavanzwa .sr-only
nekirasi . .
Zvakafanana nemakirasi emavara emavara echinyorwa, nyore nyore kuseta kumashure kwechinhu kune chero kirasi yemamiriro. Anchor zvikamu zvichasviba pane hover, senge makirasi ezvinyorwa.
Nullam id id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit sit amet non magna.
Etiam porta sem malesuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Dzimwe nguva makirasi emamiriro ekunze haagone kushandiswa nekuda kwekutsanangurwa kweimwe sarudzo. Mune zvimwe zviitiko, yakakwana workaround ndeyekuputira chinhu chechinhu chako mune <div>
nekirasi.
Sezvinoita mavara emukati , ita shuwa kuti chero chirevo chinopikiswa kuburikidza neruvara chinounzwa muchimiro chisiri chekuratidzira chete.
Shandisa generic yekuvhara icon yekudzinga zvirimo senge modal uye chenjedzo.
Shandisa magaro kuratidza kudonha mashandiro uye gwara. Ziva kuti iyo default caret inodzokera kumashure otomatiki mumamenu ekudonha .
Yangarara chinhu kuruboshwe kana kurudyi nekirasi. !important
inosanganisirwa kudzivirira nyaya dzakanangana. Makirasi anogonawo kushandiswa semisanganiswa.
Seta chinhu display: block
uye pakati nepakati kuburikidza ne margin
. Inowanikwa semusanganiswa uye kirasi.
Zviri nyore kujekesa float
s nekuwedzera .clearfix
kune chinhu chemubereki . Inoshandisa iyo micro clearfix sezvakafarirwa naNicolas Gallagher. Inogonawo kushandiswa semusanganiswa.
Manikidza chinhu kuti chiratidzwe kana kuvanzwa ( kusanganisira yevaverengi vescreen ) nekushandiswa .show
uye .hidden
makirasi. Aya makirasi anoshandisa !important
kudzivirira kukonana kwakasiyana, kungofanana nekuyangarara kwekukurumidza . Ivo vanongowanikwa kune block level toggling. Vanogonawo kushandiswa semisanganiswa.
.hide
iripo, asi haisi nguva dzose inokanganisa vaverengi vezvidzitiro uye inodzikiswa kubva pav3.0.1 . Shandisa .hidden
kana .sr-only
panzvimbo.
Uyezve, .invisible
inogona kushandiswa kushandura chete kuoneka kwechinhu, zvichireva kuti display
haina kuchinjwa uye chinhu chinogona kuramba chichikanganisa kuyerera kwegwaro.
Viga chinhu kune ese maturusi kunze kwekuverengera skrini ine .sr-only
. Sanganisa .sr-only
nekuratidza .sr-only-focusable
chinhu zvakare kana chakanangana (semuenzaniso nekhibhodi-chete mushandisi). Zvinodikanwa pakutevera nzira dzakanakisa dzekuwanikwa . Inogonawo kushandiswa semisanganiswa.
Shandisa .text-hide
kirasi kana mixin kubatsira kutsiva chinyorwa chechinhu nemufananidzo wekumashure.
Kuti uwedzere kusimudzira nharembozha, shandisa aya makirasi ekushandisa kuratidza uye kuviga zvirimo nemudziyo kuburikidza nemubvunzo wenhau. Zvinosanganisirwawo makirasi ekushandisa ekushandura zvirimo kana zvadhindwa.
Edza kushandisa izvi zvishoma uye dzivirira kugadzira shanduro dzakasiyana dzesaiti imwechete. Pane kudaro, zvishandise kutsigira mharidzo yemudziyo wega wega.
Shandisa imwe chete kana musanganiswa wemakirasi aripo ekushandura zvirimo mukati mekuona mabreakpoints.
Midziyo midiki yakawedzeraMafoni (<768px) | Zvigadzirwa zvidukuMahwendefa (≥768px) | Zvishandiso zvepakatiDesktops (≥992px) | Zvishandiso zvakakuraDesktops (≥1200px) | |
---|---|---|---|---|
.visible-xs-* |
Visible | Hidden | Hidden | Hidden |
.visible-sm-* |
Hidden | Visible | Hidden | Hidden |
.visible-md-* |
Hidden | Hidden | Visible | Hidden |
.visible-lg-* |
Hidden | Hidden | Hidden | Visible |
.hidden-xs |
Hidden | Visible | Visible | Visible |
.hidden-sm |
Visible | Hidden | Visible | Visible |
.hidden-md |
Visible | Visible | Hidden | Visible |
.hidden-lg |
Visible | Visible | Visible | Hidden |
Kubva pav3.2.0, .visible-*-*
makirasi ega ega ekutyora anouya mumisiyano mitatu, imwe yeCSS yega display
yega kukosha kwepfuma yakanyorwa pazasi.
Boka remakirasi | CSSdisplay |
---|---|
.visible-*-block |
display: block; |
.visible-*-inline |
display: inline; |
.visible-*-inline-block |
display: inline-block; |
Saka, kune mamwe madiki ( xs
) masikirini semuenzaniso, .visible-*-*
makirasi aripo ndeaya: .visible-xs-block
, .visible-xs-inline
, uye .visible-xs-inline-block
.
Iwo makirasi .visible-xs
, .visible-sm
, .visible-md
, uye .visible-lg
aripo, asi akaregwa kubva pav3.2.0 . Iwo anenge akaenzana ne .visible-*-block
, kunze kwekunge nemamwe makesi akakosha ekuchinja-ane <table>
hukama.
Zvakafanana nemakirasi enguva dzose anopindura, shandisa izvi kushandura zvinyorwa kuti zvidhindwe.
Makirasi | Browser | Dhinda |
---|---|---|
.visible-print-block .visible-print-inline .visible-print-inline-block |
Hidden | Visible |
.hidden-print |
Visible | Hidden |
Kirasi .visible-print
iripo zvakare asi yakarambwa kubva pav3.2.0 . Inoda kuenzana ne .visible-print-block
, kunze kwekunge nemamwe <table>
makesi akakosha e-zvine hukama.
Rezesa bhurawuza rako kana kurodha pamidziyo yakasiyana kuti uedze makirasi anopindura ekushandisa.
Macheki egirinhi anoratidza kuti chinhu chinoonekwa mune yako yazvino yekuona.
Pano, macheki egirini anoratidzawo kuti chinhu chakavigwa mune yako yazvino yekuona.
Bootstrap's CSS yakavakirwa paZvishoma, preprocessor ine mamwe maitiro senge akasiyana, musanganiswa, uye mabasa ekunyora CSS. Avo vari kutsvaga kushandisa sosi Mashoma mafaera panzvimbo yemafaira edu akaunganidzwa eCSS anogona kushandisa akawanda akasiyana uye masanganiswa atinoshandisa mukati mehurongwa.
Grid variables uye masanganiswa akafukidzwa mukati meiyo Grid system chikamu .
Bootstrap inogona kushandiswa nenzira dzinenge mbiri: neiyo CSS yakaunganidzwa kana nekwakabva Mashoma mafaera. Kuti uunganidze maFaera Mashoma, bvunza chikamu cheKutanga kuti ungaseta sei nharaunda yako yekusimudzira kuti uite mirairo inodiwa.
Maturusi ekubatanidza echitatu anogona kushanda neBootstrap, asi haatsigirwe nechikwata chedu chepakati.
Misiyano inoshandiswa mupurojekiti yese senzira yekuisa pakati uye kugovana hunhu hunowanzo shandiswa semavara, kupatsanurana, kana font stacks. Kuti uwane kuparara kwakazara, ndapota ona iyo Customizer .
Shandisa zviri nyore zvirongwa zviviri zvemavara: greyscale uye semantic. Grayscale mavara anopa kukurumidza kuwana kune anowanzo shandiswa mimvuri yedema nepo semantic inosanganisira akasiyana mavara akagoverwa kune zvine musoro mamiriro ezvinhu.
Shandisa chero yeaya mavara akasiyana sezvaari kana kuti aapezve kune zvimwe zvine musoro zvakasiyana zvepurojekiti yako.
A mashoma emhando dzakasiyana dzekukurumidza kugadzirisa akakosha zvinhu zvesaiti yako skeleton.
Nyora zvinyoreso zvinongedzo zvako zvine ruvara rwakakodzera neukoshi humwe chete.
Ziva kuti iyo @link-hover-color
inoshandisa basa, chimwe chinotyisa chishandiso kubva kuChidiki, kugadzira otomatiki kugadzira iyo chaiyo hover ruvara. Unogona kushandisa darken
, lighten
, saturate
, uye desaturate
.
Gadzirisa yako typeface, saizi yemavara, inotungamira, uye nezvimwe zvine mashoma anokurumidza kusiyanisa. Bootstrap inoshandisa izvi zvakare kuti ipe nyore typographic musanganiswa.
Maviri anokurumidza akasiyana ekugadzirisa nzvimbo uye zita refaira rezvidhori zvako.
Zvikamu mukati meBootstrap zvinoshandisa mamwe madhizaini ekuseta zvakajairika. Heano anonyanya kushandiswa.
Vatengesi musanganiswa mamisanganiswa ekubatsira kutsigira akawanda mabhurawuza nekubatanidza ese akakodzera vatengesi prefixes muCSS yako yakaunganidzwa.
Rongedzazve zvikamu zvako zvebhokisi modhi nemusanganiswa mumwe chete. Kuti uwane mamiriro, ona chinyorwa ichi chinobatsira kubva kuMozilla .
Iyo mixin inodzikiswa kubva kuv3.2.0 , nekuunza Autoprefixer. Kuchengetedza kumashure-kuenderana, Bootstrap icharamba ichishandisa mixin mukati kusvika Bootstrap v4.
Nhasi mabhurawuza ese emazuva ano anotsigira iyo isina-prefixed border-radius
pfuma. Saka nekudaro, hapana .border-radius()
mixin, asi Bootstrap inosanganisira mapfupi ekukurumidza kutenderedza makona maviri kune rimwe divi rechinhu.
Kana vateereri vako vari kushandisa azvino uye makuru mabhurawuza nemidziyo, ive shuwa yekungoshandisa iyo box-shadow
pfuma yega. Kana iwe uchida rutsigiro rwekare Android (pre-v4) uye iOS zvishandiso (pre-iOS 5), shandisa yakarasika mixin kutora -webkit
prefix inodiwa.
Iyo mixin inodzikiswa sev3.1.0 , sezvo Bootstrap isingatsigire zviri pamutemo mapuratifomu echinyakare asingatsigire midziyo yakajairwa. Kuchengetedza kumashure-kuenderana, Bootstrap icharamba ichishandisa mixin mukati kusvika Bootstrap v4.
Iva nechokwadi chekushandisa rgba()
mavara mubhokisi rako mimvuri kuti isanganise seamless sezvinobvira nemashure.
Multiple musanganiswa kuitira kushanduka. Seta ruzivo rwese rwekuchinja neimwe, kana tsanangura kunonoka kwakasiyana uye nguva sezvinodiwa.
Iwo mamixins akadzikiswa sev3.2.0, nekuunza Autoprefixer. Kuchengetedza kumashure-kuenderana, Bootstrap icharamba ichishandisa mamikisi mukati kusvika Bootstrap v4.
Tenderedza, kuyera, dudzira (fambisa), kana kutsveta chero chinhu.
Iwo mamixins akadzikiswa sev3.2.0, nekuunza Autoprefixer. Kuchengetedza kumashure-kuenderana, Bootstrap icharamba ichishandisa mamikisi mukati kusvika Bootstrap v4.
Musanganiswa mumwechete wekushandisa ese eCSS3's animation properties mune imwe chirevo uye mamwe masanganiswa ezvivakwa zvega.
Iwo mamixins akadzikiswa sev3.2.0, nekuunza Autoprefixer. Kuchengetedza kumashure-kuenderana, Bootstrap icharamba ichishandisa mamikisi mukati kusvika Bootstrap v4.
Seta iyo opacity kune ese mabhurawuza uye ipa filter
yekudzokera shure kweIE8.
Ipa mamiriro ekugadzirisa fomu mukati mechikamu chimwe nechimwe.
Gadzira makoramu kuburikidza neCSS mukati mechinhu chimwe chete.
Shandura chero mavara maviri zviri nyore kuita yekumashure gradient. Wana imwe yepamusoro uye isa nzira, shandisa mavara matatu, kana shandisa radial gradient. Nemusanganiswa mumwechete iwe unowana ese prefixed syntaxes iwe yauchazoda.
Iwe unogona zvakare kutsanangura kona yeakajairwa maviri-ruvara, mutsara gradient:
Kana iwe uchida barber-stripe style gradient, zviri nyore, zvakare. Ingotsanangura ruvara rumwe chete uye tichafukidza mutsetse muchena unopenya.
Simudza ante uye shandisa mavara matatu panzvimbo. Seta yekutanga ruvara, rwechipiri ruvara, rwechipiri ruvara rwekumira (yepakati kukosha se25%), uye yechitatu ruvara ine aya masanganiswa:
Musoro! Kana iwe uchizoda kubvisa gradient, ita shuwa kubvisa chero IE-chaiyo filter
yaungave wakawedzera. Iwe unogona kuzviita nekushandisa musanganiswa .reset-filter()
pamwe chete background-image: none;
.
Utility musanganiswa ndiwo musanganiswa unosanganisa neimwe nzira isina hukama CSS zvivakwa kuti uwane chakananga chinangwa kana basa.
Kanganwa kuwedzera class="clearfix"
kune chero chinhu uye panzvimbo pacho wedzera .clearfix()
mixin pazvinenge zvakakodzera. Inoshandisa iyo micro clearfix kubva kuna Nicolas Gallagher .
Kurumidza kuisa chero chinhu mukati memubereki wayo. Inoda width
kana max-width
kuiswa.
Taura hukuru hwechinhu zviri nyore.
Gadzirisa zviri nyore sarudzo dzeresize kune chero textarea, kana chero chimwe chinhu. Defaults kune yakajairika browser maitiro ( both
).
Nyoresa kutapudza mavara neellipsis ine musanganiswa mumwe chete. Inoda kuti chinhu chive block
kana inline-block
nhanho.
Rondedzera nzira mbiri dzemifananidzo uye @1x chiyero chemufananidzo, uye Bootstrap ichapa @2x media query. Kana uine mifananidzo yakawanda yekushandira, funga kunyora retina mufananidzo wako CSS nemaoko mune imwechete media query.
Nepo Bootstrap yakavakirwa paZvishoma, ine zvakare yepamutemo Sass port . Isu tinoichengeta mune yakaparadzana GitHub repository uye tinobata zvigadziriso neshanduko script.
Sezvo chiteshi cheSass chine repo yakaparadzana uye ichishandira vateereri vakasiyana zvishoma, zviri mukati meprojekiti zvinosiyana zvakanyanya kubva kune chikuru Bootstrap chirongwa. Izvi zvinoita kuti chiteshi cheSass chienderane neakawanda maSass-based system sezvinobvira.
Path | Tsanangudzo |
---|---|
lib/ |
Ruby gem kodhi (Sass kumisikidza, Rails uye Compass kubatanidzwa) |
tasks/ |
Shanduro zvinyorwa (kutendeukira kumusoro Zvishoma kuenda kuSass) |
test/ |
Compilation miedzo |
templates/ |
Compass package inoratidza |
vendor/assets/ |
Sass, JavaScript, uye mafonti mafaera |
Rakefile |
Mabasa emukati, senge rake uye shandura |
Shanyira Sass port's GitHub repository kuti uone mafaera aya achiita.
Kuti uwane ruzivo rwekuisa nekushandisa Bootstrap yeSass, bvunza iyo GitHub repository readme . Ndiyo yakanyanya kusvika pazvino sosi uye inosanganisira ruzivo rwekushandisa neRails, Compass, uye yakajairwa Sass mapurojekiti.