CSS
Igenamiterere rya CSS kwisi yose, ibice byingenzi bya HTML byanditse kandi byongerewe imbaraga hamwe namasomo yagutse, hamwe na sisitemu ya gride igezweho.
Igenamiterere rya CSS kwisi yose, ibice byingenzi bya HTML byanditse kandi byongerewe imbaraga hamwe namasomo yagutse, hamwe na sisitemu ya gride igezweho.
Shakisha hasi kumurongo wingenzi wibikorwa remezo bya Bootstrap, harimo nuburyo bwacu bwo kurushaho gutera imbere, byihuse, bikomeye.
Bootstrap ikoresha ibintu bimwe na bimwe bya HTML hamwe na CSS isaba gukoresha inyandiko ya HTML5. Shyiramo intangiriro yimishinga yawe yose.
Hamwe na Bootstrap 2, twongeyeho uburyo bwa mobile bugendanwa kubintu byingenzi byingenzi. Hamwe na Bootstrap 3, twongeye kwandika umushinga wo kuba inshuti igendanwa kuva tugitangira. Aho kongeramo uburyo bwa mobile igendanwa, batetse neza muribanze. Mubyukuri, Bootstrap ni mobile mbere . Imiterere yambere ya mobile irashobora kuboneka mubitabo byose aho kuba muri dosiye zitandukanye.
Kugirango wemeze neza kandi ukore zooming, ongeraho kureba meta tagi yawe <head>
.
Urashobora guhagarika ubushobozi bwo guhinduranya kubikoresho bigendanwa wongeyeho user-scalable=no
kureba kuri meta tag. Ibi birahagarika zooming, bivuze ko abakoresha bashoboye gusa kuzunguruka, nibisubizo kurubuga rwawe ukumva bisa nkibisabwa kavukire. Muri rusange, ibi ntabwo tubisaba kurubuga rwose, koresha rero ubwitonzi!
Bootstrap ishyiraho ibanze kwisi yose, imyandikire, hamwe nuburyo bwo guhuza. By'umwihariko, twe:
background-color: #fff;
kuribody
@font-family-base
,, @font-size-base
na @line-height-base
Ibiranga nkimyandikire yacu@link-color
kandi ushyire kumurongo uhuza gusa:hover
Ubu buryo bushobora kuboneka imbere scaffolding.less
.
Kugirango tunoze amashusho yambukiranya, dukoresha Normalize.css , umushinga wa Nicolas Gallagher na Jonathan Neal .
Bootstrap isaba ikintu kirimo gupfunyika ibiri kurubuga no kubika sisitemu ya gride. Urashobora guhitamo kimwe mubintu bibiri kugirango ukoreshe mumishinga yawe. Menya ko, bitewe padding
nibindi byinshi, nta kintu na kimwe kirimo.
Koresha .container
kubikoresho byubugari byashubijwe neza.
Koresha .container-fluid
ubugari bwuzuye bwuzuye, uzenguruke ubugari bwose bwo kureba.
Bootstrap ikubiyemo sisitemu yitabiriwe, igendanwa ya mbere ya gride ya sisitemu igereranya neza inkingi zigera kuri 12 uko igikoresho cyangwa ubunini bwo kureba bwiyongera. Harimo ibyiciro byateganijwe mbere yuburyo bworoshye bwo guhitamo, kimwe nuruvange rukomeye rwo kubyara ibisobanuro byinshi .
Sisitemu ya gride ikoreshwa mugukora page page binyuze murukurikirane rwimirongo ninkingi bikubiyemo ibikubiyemo. Dore uko sisitemu ya Bootstrap ikora:
.container
(ubugari bwagutse) cyangwa .container-fluid
(ubugari bwuzuye) kugirango ihuze neza na padi..row
kandi .col-xs-4
birahari mugukora byihuse imiterere ya grid. Imvange nkeya irashobora kandi gukoreshwa muburyo bwinshi bwo gusobanura.padding
. Iyo padi isibanganya umurongo kumurongo wambere nuwanyuma ukoresheje margin mbi kuri .row
s..col-xs-4
..col-md-*
icyiciro icyo aricyo cyose ntabwo bizagira ingaruka kumyandikire yabikoresho biciriritse gusa ahubwo no kubikoresho binini niba .col-lg-*
ishuri ridahari.Reba ingero zo gushyira mu bikorwa aya mahame kuri kode yawe.
Twifashishije ibibazo byitangazamakuru bikurikira muri dosiye zacu nkeya kugirango dukore urufunguzo rwibanze muri sisitemu ya gride.
Rimwe na rimwe twaguka kuri ibyo bibazo byitangazamakuru kugirango dushyiremo max-width
imipaka CSS kumurongo mugufi wibikoresho.
Reba uburyo ibintu bya sisitemu ya Bootstrap ikora mubikoresho byinshi hamwe nameza meza.
Ibikoresho bito byiyongera Terefone (<768px) | Ibikoresho bito Ibinini (68768px) | Ibikoresho biciriritse Ibiro (≥992px) | Ibikoresho binini Ibiro (≥1200px) | |
---|---|---|---|---|
Imyitwarire ya gride | Utambitse igihe cyose | Yasenyutse kugirango utangire, utambitse hejuru yumwanya | ||
Ubugari bwa kontineri | Nta na kimwe (auto) | 750px | 970px | 1170px |
Icyiciro cyambere | .col-xs- |
.col-sm- |
.col-md- |
.col-lg- |
# yinkingi | 12 | |||
Ubugari bw'inkingi | Imodoka | ~ 62px | ~ 81px | ~ 97px |
Ubugari | 30px (15px kuri buri ruhande rw'inkingi) | |||
Nestable | Yego | |||
Offsets | Yego | |||
Gutumiza inkingi | Yego |
Ukoresheje umurongo umwe wibyiciro bya .col-md-*
gride, urashobora gukora sisitemu shingiro ya gride itangira gutondekanya kubikoresho bigendanwa hamwe nibikoresho bya tablet (byoroheje bito kugeza bito) mbere yo gutambuka kubikoresho bya desktop (hagati). Shyira grid inkingi muri buri .row
.
Hindura icyaricyo cyose cyagutse cya grid imiterere muburyo bwuzuye bwubugari uhindura hanze yawe .container
kuri .container-fluid
.
Ntushaka ko inkingi zawe zishira mubikoresho bito? Koresha ibikoresho byoroheje kandi biciriritse bya gride ibyiciro wongeyeho .col-xs-*
.col-md-*
inkingi zawe. Reba urugero rukurikira kugirango ubone igitekerezo cyiza cyukuntu byose bikora.
Wubake kurugero rwabanje mukurema ndetse imbaraga nyinshi kandi zikomeye hamwe .col-sm-*
namasomo ya tablet.
Niba inkingi zirenga 12 zishyizwe mumurongo umwe, buri tsinda ryinyongera zinkingi, nkigice kimwe, zizingira kumurongo mushya.
Hamwe nimirongo ine ya gride iboneka ugomba guhura nibibazo aho, aho bigarukira, inkingi zawe ntizisobanutse neza nkuko imwe ari ndende kurenza iyindi. Kugirango ukosore, koresha uruvange rwa a .clearfix
hamwe nibyiciro byingirakamaro byamasomo .
Usibye gusiba inkingi kumurongo ushubije, ushobora gukenera gusubiramo offsets, gusunika, cyangwa gukurura . Reba ibi mubikorwa murugero rwa grid .
Himura inkingi iburyo ukoresheje .col-md-offset-*
amasomo. Aya masomo yongerera ibumoso bwinkingi *
yinkingi. Kurugero, .col-md-offset-4
yimuka .col-md-4
hejuru yinkingi enye.
Urashobora kandi kurenga offsets kuva murwego rwo hasi rwa grid hamwe .col-*-offset-0
namasomo.
Kugirango ushire ibikubiyemo hamwe na gride isanzwe, ongeramo ibishya .row
kandi ushireho .col-sm-*
inkingi muburyo buriho .col-sm-*
. Imirongo yashizwemo igomba gushiramo urutonde rwinkingi ziyongera kuri 12 cyangwa nkeya (ntibisabwa ko ukoresha inkingi 12 zose ziboneka).
Byoroshe guhindura gahunda yuburyo bwubatswe muri grid inkingi hamwe .col-md-push-*
nibyiciro byo .col-md-pull-*
guhindura.
Usibye ibyiciro bya gride byateguwe kugirango byihute, Bootstrap ikubiyemo impinduka nke hamwe nivanga kugirango byihute kubyara ibintu byoroheje, bisobanutse.
Ibihinduka bigena umubare winkingi, ubugari bwamazi, hamwe nibitangazamakuru byabajijwe aho utangirira kureremba inkingi. Dukoresha ibi kugirango tubyare ibyiciro byateganijwe byateganijwe hejuru, kimwe no kuvanga ibicuruzwa byavuzwe haruguru.
Imvange zikoreshwa zifatanije na gride ihindagurika kugirango itange ibisobanuro bya CSS kubisobanuro bya grid inkingi.
Urashobora guhindura ibihinduka kubiciro byawe bwite, cyangwa ugakoresha gusa ivanga nagaciro kabo gasanzwe. Dore urugero rwo gukoresha igenamiterere risanzwe kugirango ukore imiterere-inkingi ebyiri hamwe nu cyuho hagati.
Imitwe yose ya HTML, <h1>
binyuze <h6>
, irahari. .h1
binyuze .h6
mumasomo nayo arahari, kuberako mugihe ushaka guhuza imyandikire yimyandikire yumutwe ariko ugashaka ko inyandiko yawe yerekanwa kumurongo.
h1. Umutwe wa Bootstrap |
Semibold 36px |
h2. Umutwe wa Bootstrap |
Semibold 30px |
h3. Umutwe wa Bootstrap |
Semibold 24px |
h4. Umutwe wa Bootstrap |
Semibold 18px |
h5. Umutwe wa Bootstrap |
Semibold 14px |
h6. Umutwe wa Bootstrap |
Semibold 12px |
Kora urumuri rworoshye, inyandiko yinyongera mumutwe uwo ariwo wose hamwe na <small>
tagi rusange cyangwa urwego .small
.
h1. Bootstrap umutwe wicyiciro cya kabiri |
h2. Bootstrap umutwe wicyiciro cya kabiri |
h3. Bootstrap umutwe wicyiciro cya kabiri |
h4. Bootstrap umutwe wicyiciro cya kabiri |
h5. Bootstrap umutwe wicyiciro cya kabiri |
h6. Bootstrap umutwe wicyiciro cya kabiri |
Bootstrap isanzwe isanzwe font-size
ni 14px , hamwe line-height
na 1.428 . Ibi birakoreshwa kuri i <body>
na paragarafu zose. Mubyongeyeho, <p>
(paragarafu) yakira hepfo ya kimwe cya kabiri cyumurongo ubarwa (10px kubwa mbere).
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur comiculus mus. Nullam id dolor id nibh ultricies ibinyabiziga.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur comiculus 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 icara amet non magna. Donec id elit non mi porta gravida kuri eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
Kora igika kigaragara wongeyeho .lead
.
Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.
Igipimo cyimyandikire ishingiye kubintu bibiri bito bihinduka mubihinduka.less : @font-size-base
na @line-height-base
. Iya mbere ni ishingiro ryimyandikire-nini ikoreshwa mugihe cyose naho icya kabiri ni umurongo-muremure. Dukoresha ibyo bihinduka hamwe nimibare yoroshye yo gukora marge, padi, hamwe numurongo-muremure wubwoko bwacu nibindi byinshi. Hindura kandi uhindure imiterere ya Bootstrap.
Kugirango ugaragaze imikorere yinyandiko kubera akamaro kayo murundi rwego, koresha <mark>
tagi.
Urashobora gukoresha ikirango kurishyira ahagaragarainyandiko.
Kugirango werekane ibice byanditse byasibwe koresha <del>
tagi.
Uyu murongo winyandiko ugenewe gufatwa nkumwandiko wasibwe.
Kugirango werekane ibice byinyandiko bitagifite akamaro koresha <s>
tagi.
Uyu murongo winyandiko ugenewe gufatwa nkibikiri ukuri.
Kugirango werekane ibyongewe kumyandiko koresha <ins>
tagi.
Uyu murongo winyandiko ugenewe gufatwa nkinyongera ku nyandiko.
Kugirango ushire ahanditse inyandiko koresha <u>
tagi.
Uyu murongo winyandiko uzatanga nkuko byashizwe kumurongo
Koresha HTML yibanze yibanze hamwe nuburyo bworoshye.
Kugirango ushimangire kumurongo cyangwa guhagarika inyandiko, koresha <small>
tagi kugirango ushireho inyandiko kuri 85% ubunini bwababyeyi. Imitwe yimitwe yakira ibyabo font-size
kubintu byashizwe <small>
.
Urashobora gukoresha ubundi buryo bwo gukoresha umurongo hamwe .small
nikibanza icyo aricyo cyose <small>
.
Uyu murongo winyandiko ugenewe gufatwa nkicapiro ryiza.
Kubitsindagira agace k'inyandiko hamwe n'imyandikire iremereye.
Igice gikurikira cyinyandiko gitangwa nkinyandiko itinyutse .
Kubitsindagira agace k'inyandiko hamwe na italike.
Igice gikurikira cyinyandiko gitangwa nkinyandiko itomoye .
Umva ko ukoresha <b>
kandi<i>
muri HTML5. <b>
igamije kwerekana amagambo cyangwa interuro uterekanye akamaro kiyongereye mugihe <i>
ahanini ari ijwi, amagambo ya tekiniki, nibindi.
Byoroshye guhindura inyandiko kubice hamwe nibyiciro byo guhuza inyandiko.
Ibumoso bwahujwe.
Hagati ihuza inyandiko.
Umwandiko uhujwe neza.
Inyandiko ifite ishingiro.
Nta nyandiko yo gupfunyika.
Hindura inyandiko mubice hamwe namasomo yinyuguti nkuru.
Inyandiko ntoya.
Inyandiko iri hejuru.
Inyuguti nkuru.
Gushyira mubikorwa uburyo bwa HTML <abbr>
kubintu bigufi hamwe namagambo ahinnye kugirango yerekane verisiyo yagutse kuri hover. Amagambo ahinnye hamwe atitle
ikiranga afite urumuri ruto ruri munsi yumupaka hamwe nugufasha indanga kuri hover, itanga ibisobanuro byinyongera kuri hover no kubakoresha tekinoroji ifasha.
Amagambo ahinnye yijambo ikiranga ni attr .
Ongeraho .initialism
mu magambo ahinnye yimyandikire ntoya.
HTML nikintu cyiza kuva gukata imigati.
Tanga amakuru yamakuru kuri ba sogokuruza hafi cyangwa umubiri wose wakazi. Bika imiterere urangiza imirongo yose hamwe <br>
.
Kugirango usubiremo ibice bikubiye mubindi bikoresho mu nyandiko yawe.
Kuzenguruka <blockquote>
kuri HTML iyo ari yo yose. Kubisobanuro bitaziguye, turasaba a <p>
.
Lorem ipsum dolor icara amet, consectetur adipiscing elit. Byuzuye posuere erat ante.
Imiterere nibirimo guhinduka kubintu byoroshye gutandukana kurwego rusanzwe <blockquote>
.
Ongeraho a <footer>
kugirango umenye inkomoko. Kuzuza izina ryinkomoko akazi <cite>
.
Lorem ipsum dolor icara amet, consectetur adipiscing elit. Byuzuye posuere erat ante.
Ongeraho .blockquote-reverse
kuri blokquote hamwe nibirimo-iburyo.
Urutonde rwibintu bitondekanya neza .
Urutonde rwibintu urutonde rufite akamaro .
Kuraho ibisanzwe list-style
n'ibumoso kuruhande rwibintu (abana bahita gusa). Ibi bireba gusa abana bahita batondekanya ibintu , bivuze ko uzakenera kongeramo urwego kurutonde urwo arirwo rwose.
Shira ibintu byose kurutonde kumurongo umwe hamwe display: inline-block;
na padi yoroheje.
Urutonde rwamagambo hamwe nibisobanuro bifitanye isano.
Kora amagambo nibisobanuro <dl>
kumurongo kumurongo. Gutangira gutondekanya nkibisanzwe <dl>
s, ariko iyo navbar yagutse, kora ibi.
Urutonde rutambitse urutonde ruzagabanya amagambo maremare kugirango ahuze inkingi yibumoso hamwe text-overflow
. Mubyerekezo bigufi, bizahinduka muburyo busanzwe buteganijwe.
Kuzuza ibice bya kode hamwe <code>
.
<section>
bigomba gupfunyika nkumurongo.
Koresha i <kbd>
kugirango werekane ibyinjijwe mubisanzwe byinjiye muri clavier.
Koresha <pre>
imirongo myinshi ya code. Witondere guhunga inguni iyo ari yo yose muri kode kugirango itangwe neza.
<p> Icyitegererezo hano ... </p>
Urashobora guhitamo kongeramo.pre-scrollable
, ruzashyiraho uburebure bwa 350px hanyuma utange y-axis umuzingo.
Kugirango werekane impinduka koresha <var>
tagi.
y = m x + b
Kugirango werekane guhagarika icyitegererezo gisohoka muri porogaramu koresha <samp>
tagi.
Iyi nyandiko igamije gufatwa nkicyitegererezo gisohoka muri porogaramu ya mudasobwa.
Kuburyo bwibanze - urumuri rworoshye kandi rutandukanya gusa - ongeraho urwego shingiro .table
kuri buriwese <table>
. Birashobora gusa nkibirenze urugero, ariko urebye ikoreshwa ryinshi ryameza kubindi bicomeka nka kalendari hamwe nabatoranya amatariki, twahisemo gutandukanya imiterere yimiterere yacu.
# | Izina | Izina ryanyuma | Izina ryukoresha |
---|---|---|---|
1 | Ikimenyetso | Otto | @mdo |
2 | Yakobo | Thornton | @fat |
3 | Larry | Inyoni |
Koresha .table-striped
kugirango wongereho zebra-gukuramo kumurongo uwo ariwo wose kumurongo muri <tbody>
.
Imbonerahamwe yanditswemo yanditswe hifashishijwe :nth-child
CSS itoranya, itaboneka muri Internet Explorer 8.
# | Izina | Izina ryanyuma | Izina ryukoresha |
---|---|---|---|
1 | Ikimenyetso | Otto | @mdo |
2 | Yakobo | Thornton | @fat |
3 | Larry | Inyoni |
Ongeraho .table-bordered
imipaka kumpande zose zameza na selile.
# | Izina | Izina ryanyuma | Izina ryukoresha |
---|---|---|---|
1 | Ikimenyetso | Otto | @mdo |
2 | Yakobo | Thornton | @fat |
3 | Larry | Inyoni |
Ongeraho .table-hover
kugirango ushoboze kugendagenda kumurongo kumurongo kumeza muri a <tbody>
.
# | Izina | Izina ryanyuma | Izina ryukoresha |
---|---|---|---|
1 | Ikimenyetso | Otto | @mdo |
2 | Yakobo | Thornton | @fat |
3 | Larry | Inyoni |
Ongeraho .table-condensed
kugirango imbonerahamwe irusheho gukata uduce twa selile mo kabiri.
# | Izina | Izina ryanyuma | Izina ryukoresha |
---|---|---|---|
1 | Ikimenyetso | Otto | @mdo |
2 | Yakobo | Thornton | @fat |
3 | Inyoni |
Koresha ibyiciro kugirango uhindure amabara kumurongo cyangwa selile.
Icyiciro | Ibisobanuro |
---|---|
.active |
Koresha ibara rya hover kumurongo runaka cyangwa selile |
.success |
Yerekana igikorwa cyatsinze cyangwa cyiza |
.info |
Yerekana impinduka zidafite aho zibogamiye cyangwa ibikorwa |
.warning |
Yerekana umuburo ushobora gukenera kwitabwaho |
.danger |
Yerekana ibikorwa biteje akaga cyangwa bishobora kuba bibi |
# | Umutwe | Umutwe | Umutwe |
---|---|---|---|
1 | Ibirimo | Ibirimo | Ibirimo |
2 | Ibirimo | Ibirimo | Ibirimo |
3 | Ibirimo | Ibirimo | Ibirimo |
4 | Ibirimo | Ibirimo | Ibirimo |
5 | Ibirimo | Ibirimo | Ibirimo |
6 | Ibirimo | Ibirimo | Ibirimo |
7 | Ibirimo | Ibirimo | Ibirimo |
8 | Ibirimo | Ibirimo | Ibirimo |
9 | Ibirimo | Ibirimo | Ibirimo |
Gukoresha ibara kugirango wongere ibisobanuro kumurongo wameza cyangwa selile kugiti cye bitanga gusa icyerekezo cyerekana, kitazashyikirizwa abakoresha tekinoroji ifasha - nkabasoma ecran. Menya neza ko amakuru yerekanwe n'ibara agaragara uhereye kubirimo ubwabyo (inyandiko igaragara mu mbonerahamwe ikurikira / umurongo), cyangwa igashyirwa mu bundi buryo, nk'inyandiko y'inyongera ihishe hamwe .sr-only
n'ishuri.
Kora imbonerahamwe isubiza mugupfunyika icyaricyo .table
cyose .table-responsive
kugirango itume izenguruka itambitse kubikoresho bito (munsi ya 768px). Iyo urebye ikintu cyose kirenze 768px ubugari, ntuzabona itandukaniro muribi mbonerahamwe.
Imbonerahamwe ishubije ikoresha overflow-y: hidden
, ikuraho ibintu byose birenze hepfo cyangwa hejuru yimeza. By'umwihariko, ibi birashobora gukuramo ibice byamanutse hamwe nandi mashyaka ya gatatu.
Firefox ifite stile yuburyo bubi burimo width
kubangamira imbonerahamwe isubiza. Ibi ntibishobora kurengerwa nta Firefox yihariye ya hack tudatanga muri Bootstrap:
Kubindi bisobanuro, soma iki gisubizo cyuzuye .
# | Umutwe | Umutwe | Umutwe | Umutwe | Umutwe | Umutwe |
---|---|---|---|---|---|---|
1 | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza |
2 | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza |
3 | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza |
# | Umutwe | Umutwe | Umutwe | Umutwe | Umutwe | Umutwe |
---|---|---|---|---|---|---|
1 | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza |
2 | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza |
3 | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza | Akazu kameza |
Ifishi yumuntu kugiti cye ihita yakira isi yose. Byose byanditse <input>
, <textarea>
hamwe <select>
nibintu hamwe .form-control
byashizweho width: 100%;
kubisanzwe. Kuzuza ibirango hamwe nubugenzuzi .form-group
kugirango ubone umwanya mwiza.
Ntukavange amatsinda yuburyo butaziguye hamwe nitsinda ryinjiza . Ahubwo, shyira itsinda ryinjiza imbere yitsinda ryitsinda.
Ongeraho kumpapuro .form-inline
zawe (zitagomba kuba a <form>
) kubumoso-buhujwe na inline-blok igenzura. Ibi birareba gusa kumiterere mubireba byibuze 768px ubugari.
Iyinjiza nuguhitamo width: 100%;
byashyizwe mubikorwa muri Bootstrap. Muburyo bwa inline, dusubiramo ko kubigenzura width: auto;
byinshi bishobora gutura kumurongo umwe. Ukurikije imiterere yawe, ubugari bwinyongera bushobora gukenerwa.
Abasomyi ba ecran bazagira ikibazo kumpapuro zawe niba udashyizemo ikirango kuri buri cyinjijwe. Kuri iyi fomu yumurongo, urashobora guhisha ibirango ukoresheje urwego .sr-only
. Hariho ubundi buryo butandukanye bwo gutanga ikirango cya tekinoroji ifasha, nka aria-label
, aria-labelledby
cyangwa title
ikiranga. Niba nta na kimwe muri ibyo gihari, abasomyi ba ecran barashobora kwitabaza gukoresha placeholder
ikiranga, niba gihari, ariko menya ko gukoresha placeholder
nkuwasimbuye ubundi buryo bwo kuranga ibimenyetso bitagiriwe inama.
Koresha Bootstrap ibyiciro byateganijwe mbere kugirango uhuze ibirango hamwe nitsinda ryuburyo bugenzura muburyo butambitse wongeyeho .form-horizontal
ifishi (itagomba kuba a <form>
). Kubikora uhindura .form-group
s kugirango witware nka grid umurongo, ntabwo rero bikenewe .row
.
Ingero zuburyo busanzwe bugenzurwa bushyigikiwe nurugero rwimiterere.
Byinshi mubisanzwe bigenzura, inyandiko-yinjiza imirima. Harimo inkunga yubwoko bwose bwa HTML5 : text
,,,,,,,,,,,, na . _ _ _ _ _password
datetime
datetime-local
date
month
time
week
number
email
url
search
tel
color
Iyinjiza izaba yuzuye gusa niba ibyatangajwe type
neza.
Ongeraho inyandiko ihuriweho cyangwa buto mbere na / cyangwa nyuma yinyandiko iyo ari yo yose <input>
, reba ibyinjijwe mumatsinda .
Ifishi igenzura ishyigikira imirongo myinshi yinyandiko. Hindura rows
ikiranga nkuko bikenewe.
Kugenzura agasanduku ni uguhitamo kimwe cyangwa byinshi murutonde, mugihe amaradiyo yo guhitamo inzira imwe muri benshi.
Isanduku yamugaye hamwe na radio birashyigikirwa, ariko kugirango utange "inyemerewe" indanga hejuru yumubyeyi , <label>
uzakenera kongeramo .disabled
ishuri kubabyeyi .radio
,, cyangwa ..radio-inline
.checkbox
.checkbox-inline
Koresha ibyiciro .checkbox-inline
cyangwa .radio-inline
amasomo kurukurikirane rwibisanduku cyangwa amaradiyo kubigenzura bigaragara kumurongo umwe.
Niba udafite inyandiko muri i <label>
, ibyinjijwe bihagaze nkuko ubyiteze. Kugeza ubu ikora gusa kubisanduku itari kumurongo. Wibuke gutanga ubundi buryo bwa label ya tekinoroji ifasha (urugero, gukoresha aria-label
).
Menya ko abantu benshi kavukire batoranijwe - cyane cyane muri Safari na Chrome - bazengurutse inguni zidashobora guhinduka binyuze border-radius
mumitungo.
Kugenzura <select>
hamwe na multiple
kiranga, amahitamo menshi yerekanwe kubisanzwe.
Mugihe ukeneye gushyira inyandiko isanzwe kuruhande rwikirango muburyo, koresha urwego .form-control-static
kuri a <p>
.
Dukuraho outline
imisusire isanzwe kumpapuro zimwe na zimwe igenzura hanyuma tugashyira a box-shadow
mu mwanya wabyo :focus
.
:focus
yerekanaIngero zavuzwe haruguru zinjiza zikoresha uburyo bwihariye mubyangombwa byacu kugirango twerekane :focus
leta kuri a .form-control
.
Ongeramo disabled
ikiranga boolean kumurongo kugirango wirinde imikoranire yabakoresha. Ibimuga byahagaritswe bigaragara byoroshye kandi wongere not-allowed
indanga.
Ongeramo disabled
ikiranga kuri a <fieldset>
kugirango uhagarike igenzura ryose <fieldset>
icyarimwe.
<a>
Mburabuzi, mushakisha izajya ifata imiterere kavukire yose ( <input>
, <select>
nibintu <button>
) imbere <fieldset disabled>
nkuwamugaye, ikumira clavier nimbeba kuri bo. Ariko, niba ifishi yawe nayo irimo <a ... class="btn btn-*">
ibintu, ibi bizahabwa gusa uburyo bwa pointer-events: none
. Nkuko byavuzwe mu gice cyerekeye leta yamugaye kuri buto (na cyane cyane mu gice cyibice bya ankeri), uyu mutungo wa CSS nturashyirwaho kandi ntabwo ushyigikiwe byuzuye muri Opera 18 na munsi, cyangwa muri Internet Explorer 11, kandi uratsinda 'kubuza abakoresha clavier kubasha kwibanda cyangwa gukora iyi link. Kugirango rero ugire umutekano, koresha JavaScript yihariye kugirango uhagarike amahuza nkaya.
Mugihe Bootstrap izakoresha ubu buryo muri mushakisha zose, Internet Explorer 11 na hepfo ntabwo ishigikira byimazeyo disabled
ikiranga kuri a <fieldset>
. Koresha JavaScript yihariye kugirango uhagarike ikibanza muri izi mushakisha.
Ongeramo readonly
ikiranga boolean kumurongo kugirango wirinde guhindura agaciro kinjiza. Gusoma-gusa ibyinjira bigaragara byoroheje (kimwe ninjiza zamugaye), ariko gumana indanga isanzwe.
Hagarika urwego rufasha inyandiko kumpapuro zigenzura.
Ubufasha bwanditse bugomba guhuzwa neza nuburyo bwo kugenzura bifitanye isano no gukoresha aria-describedby
ikiranga. Ibi bizemeza ko tekinoroji ifasha - nk'abasomyi ba ecran - izatangaza iyi nyandiko ifasha mugihe uyikoresha yibanze cyangwa yinjiye kugenzura.
Bootstrap ikubiyemo uburyo bwo kwemeza amakosa, kuburira, hamwe nubutsinzi bwerekana kugenzura imiterere. Gukoresha, Ongeraho .has-warning
, .has-error
Cyangwa .has-success
Kubintu Byababyeyi. Icyo ari cyo cyose .control-label
, .form-control
kandi .help-block
muri kiriya kintu kizakira uburyo bwo kwemeza.
Gukoresha ubu buryo bwo kwemeza kugirango werekane imiterere yubugenzuzi butanga gusa ishusho, yerekana ibara ryerekana ibimenyetso, bitazashyikirizwa abakoresha tekinoroji ifasha - nk'abasomyi ba ecran - cyangwa kubakoresha amabara.
Menya neza ko ubundi buryo bwerekana leta butangwa. Kurugero, urashobora gushiramo igitekerezo kijyanye na leta mumyandiko igenzura <label>
ubwayo (nkuko bigenda murugero rukurikira kode), shyiramo Glyphicon (hamwe nibindi bisobanuro ukoresheje .sr-only
ishuri - reba ingero za Glyphicon ), cyangwa utanga an infashanyo yinyongera guhagarika. By'umwihariko kubijyanye na tekinoroji ifasha, kugenzura imiterere itemewe nayo ishobora guhabwa aria-invalid="true"
ikiranga.
Urashobora kandi kongeramo ibitekerezo byubushakashatsi utabishaka wongeyeho .has-feedback
hamwe nigishushanyo cyiburyo.
Udushushondanga dusubiza gusa dukorana <input class="form-control">
nibintu byanditse.
Intoki zihererekanyabubasha amashusho arakenewe kubisubizo bidafite ikirango no kubitsinda ryinjiza hamwe na on-on iburyo. Urashishikarizwa gutanga ibirango kubintu byose byinjira kubwimpamvu ziboneka. Niba ushaka kubuza ibirango kutagaragara, uhishe hamwe .sr-only
nishuri. Niba ugomba gukora udafite ibirango, hindura top
agaciro k'igitekerezo cyo gutanga ibitekerezo. Kubitsinda ryitsinda, hindura right
agaciro kuri pigiseli ikwiye bitewe n'ubugari bwa addon yawe.
Kugirango umenye neza ko tekinoroji ifasha - nk'abasomyi ba ecran - yerekana neza ibisobanuro by'ishusho, inyandiko yinyongera ihishe igomba gushyirwa hamwe .sr-only
nishuri kandi igahuzwa neza nuburyo bugenzurwa bijyanye no gukoresha aria-describedby
. Ubundi, menya neza ko ibisobanuro (kurugero, kuba hari umuburo kumwanya runaka winjira) watanzwe mubundi buryo, nko guhindura inyandiko yibyukuri <label>
bifitanye isano no kugenzura ifishi.
Nubwo ingero zikurikira zimaze kuvuga imiterere yo kwemeza imiterere yabyo igenzura mu <label>
nyandiko ubwayo, tekinike yavuzwe haruguru (ukoresheje .sr-only
inyandiko na aria-describedby
) yashyizwemo intego zerekana.
.sr-only
nibirango byihisheNiba ukoresheje urwego .sr-only
kugirango uhishe ifishi igenzura <label>
(kuruta gukoresha ubundi buryo bwo kuranga ibimenyetso aria-label
, nkibiranga), Bootstrap izahita ihindura imyanya yikimenyetso imaze kongerwaho.
Shiraho uburebure ukoresheje amasomo nka .input-lg
, hanyuma ushireho ubugari ukoresheje grid inkingi ibyiciro nka .col-lg-*
.
Kora uburebure burebure cyangwa bugufi bugenzura guhuza ingano ya buto.
Ingano yihuse ibirango na form igenzura imbere .form-horizontal
wongeyeho .form-group-lg
cyangwa .form-group-sm
.
Kuzuza inyongeramusaruro muri grid inkingi, cyangwa ikintu icyo aricyo cyose cyababyeyi, kugirango byoroshye ubugari bwifuzwa.
Koresha buto yamasomo kuri an<a>
, <button>
cyangwa <input>
element.
Mugihe ibyiciro bya buto bishobora gukoreshwa kubintu , gusa <a>
ibintu birashyigikirwa muri nav na navbar.<button>
<button>
Niba <a>
ibintu bikoreshwa mugukora buto - gukurura page-page imikorere, aho kugana kurundi nyandiko cyangwa igice kiri kurupapuro rwubu - bagomba no guhabwa ibikwiye role="button"
.
Nkumwitozo mwiza, turasaba cyane gukoresha <button>
element igihe cyose bishoboka kugirango tumenye guhuza kwambukiranya amashusho.
Mubindi bintu, hariho ikosa muri Firefox <30 ritubuza gushiraho igenamiterere line-height
rya <input>
buto-ishingiye, bigatuma badahuza neza nuburebure bwizindi buto kuri Firefox.
Koresha icyaricyo cyose kiboneka cyamasomo kugirango ukore vuba buto.
Gukoresha ibara kugirango wongere ibisobanuro kuri buto gusa itanga icyerekezo kigaragara, kitazashyikirizwa abakoresha tekinoroji ifasha - nk'abasoma ecran. Menya neza ko amakuru yerekanwe n'ibara agaragara uhereye kubirimo ubwabyo (inyandiko igaragara ya buto), cyangwa igashyirwa muburyo butandukanye, nk'inyandiko yinyongera ihishe hamwe .sr-only
nishuri.
Ibyiza binini cyangwa bito? Ongeraho .btn-lg
, .btn-sm
cyangwa .btn-xs
kubindi binini.
Kora urwego rwo guhagarika buto-izenguruka ubugari bwuzuye bwababyeyi - wongeyeho .btn-block
.
Utubuto tuzagaragara gukanda (hamwe numwijima wijimye, umupaka wijimye, no gushiramo igicucu) mugihe ukora. Kubintu <button>
, ibi bikorwa binyuze :active
. Kubintu <a>
, byakozwe hamwe .active
. Ariko, urashobora gukoresha .active
kuri <button>
s (kandi ushizemoaria-pressed="true"
ikiranga) mugihe ukeneye kwigana leta ikora gahunda.
Ntibikenewe ko wongera :active
nkuko ari pseudo-urwego, ariko niba ukeneye guhatira isura imwe, jya imbere wongere .active
.
Ongeraho .active
icyiciro kuri <a>
buto.
Kora utubuto dusa nkudashobora kubisubiza inyuma opacity
.
Ongeramo disabled
ikiranga kuri <button>
buto.
Niba wongeyeho disabled
ikiranga kuri a <button>
, Internet Explorer 9 na hepfo izatanga inyandiko imvi hamwe ninyandiko mbi-igicucu tudashobora gukosora.
Ongeraho .disabled
icyiciro kuri <a>
buto.
Dukoresha .disabled
nkibyiciro byingirakamaro hano, bisa nicyiciro rusange .active
, ntabwo rero prefix isabwa.
Iri somo rikoresha pointer-events: none
kugerageza guhagarika imikorere yimikorere ya <a>
s, ariko uwo mutungo wa CSS nturashyirwaho kandi ntabwo ushyigikiwe byuzuye muri Opera 18 na munsi, cyangwa muri Internet Explorer 11. Byongeye kandi, no muri mushakisha ikora inkunga pointer-events: none
, clavier kugendana bikomeje kutagira ingaruka, bivuze ko abakoresha clavier babonye hamwe nabakoresha tekinoroji ifasha bazakomeza gukora iyo miyoboro. Kugirango rero ugire umutekano, koresha JavaScript yihariye kugirango uhagarike amahuza nkaya.
Amashusho muri Bootstrap 3 arashobora gukorwa muburyo bworoshye-wongeyeho .img-responsive
ishuri. Ibi birakurikizwa max-width: 100%;
, height: auto;
no display: block;
kubishusho kuburyo bipima neza kubintu byababyeyi.
Guhuza amashusho akoresha urwego .img-responsive
, koresha .center-block
aho .text-center
. Reba icyiciro cyabafasha igice kugirango ubone ibisobanuro birambuye kubyerekeye .center-block
imikoreshereze.
Muri Internet Explorer 8-10, amashusho ya SVG afite .img-responsive
ubunini butagereranywa. Kugira ngo ukosore ibi, ongera width: 100% \9;
aho bikenewe. Bootstrap ntabwo ikoreshwa muburyo bwikora kuko itera ingorane kumiterere yandi mashusho.
Ongeraho amasomo kubintu <img>
byoroshye gushushanya amashusho mumushinga uwo ariwo wose.
Wibuke ko Internet Explorer 8 ibura inkunga kumpande zegeranye.
Tanga ibisobanuro ukoresheje ibara hamwe nintoki zo gushimangira amasomo yingirakamaro. Ibi birashobora kandi gukoreshwa kumihuza kandi bizacura umwijima kuri hover nkuburyo busanzwe bwo guhuza.
Fusce dapibus, tellus ac cursus commodo, iyicarubozo mauris nibh.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit icara amet non magna.
Etiam porta sem maleuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Rimwe na rimwe, amasomo yo gushimangira ntashobora gukoreshwa kubera umwihariko wundi watoranije. Mu bihe byinshi, akazi gahagije ni ugupfunyika inyandiko yawe <span>
hamwe nishuri.
Gukoresha ibara kugirango wongere ibisobanuro bitanga gusa icyerekezo cyerekana, kitazashyikirizwa abakoresha tekinoroji ifasha - nk'abasoma ecran. Menya neza ko amakuru yerekanwe nibara yaba agaragara mubirimo ubwabyo (amabara avugwa akoreshwa gusa mugushimangira ibisobanuro bimaze kugaragara mubyanditswe / ikimenyetso), cyangwa bigashyirwa muburyo butandukanye, nkinyandiko yinyongera ihishe hamwe .sr-only
nishuri .
Bisa nibisobanuro byanditseho ibara ryamasomo, byoroshye gushiraho inyuma yibintu kurwego urwo arirwo rwose. Ibice bya Anchor bizijimye kuri hover, kimwe namasomo yinyandiko.
Nullam id dolor id nibh ultricies vehicula ut id elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Maecenas sed diam eget risus varius blandit icara amet non magna.
Etiam porta sem maleuada magna mollis euismod.
Donec ullamcorper nulla non metus auctor fringilla.
Rimwe na rimwe, ibyiciro byibanze ntibishobora gukoreshwa kubera umwihariko wundi watoranije. Rimwe na rimwe, akazi gahagije ni ugupfunyika ibintu byawe muri <div>
hamwe nishuri.
Kimwe namabara asobanutse , menya neza ko igisobanuro icyo aricyo cyose cyatanzwe binyuze mumabara nacyo gitangwa muburyo butagaragajwe gusa.
Koresha igishushanyo rusange cyo gufunga kugirango wirukane ibirimo nka moderi no kumenyesha.
Koresha carets kugirango werekane imikorere yamanuka nicyerekezo. Menya neza ko caret isanzwe izahita ihinduka muri menu yataye .
Fata ikintu ibumoso cyangwa iburyo hamwe nishuri. !important
irimo kugirango wirinde ibibazo byihariye. Amasomo arashobora kandi gukoreshwa nka mixin.
Shiraho ikintu kuri display: block
na hagati ukoresheje margin
. Biraboneka nka mixin hamwe nishuri.
Byoroshye gusiba float
s wongeyeho .clearfix
kubintu byababyeyi . Koresha micro clearfix nkuko ikunzwe na Nicolas Gallagher. Irashobora kandi gukoreshwa nka mixin.
Guhatira ikintu cyerekanwa cyangwa cyihishe ( harimo nabasomyi ba ecran.show
) hamwe no gukoresha .hidden
amasomo. Aya masomo akoresha !important
kugirango yirinde amakimbirane yihariye, kimwe no kureremba byihuse . Baraboneka gusa kumurongo wo guhagarika. Birashobora kandi gukoreshwa nkivanga.
.hide
irahari, ariko ntabwo buri gihe igira ingaruka kubasoma ecran kandi iteshwa agaciro nkuko v3.0.1. Koresha .hidden
cyangwa .sr-only
aho.
Byongeye kandi, .invisible
irashobora gukoreshwa muguhindura gusa kugaragara kwikintu, bivuze ko display
kidahinduwe kandi ikintu gishobora kugira ingaruka kumyandiko.
Hisha ikintu kubikoresho byose usibye abasoma ecran hamwe .sr-only
. Huza .sr-only
hamwe .sr-only-focusable
kugirango werekane ikintu nanone iyo cyibanze (urugero: ukoresha clavier gusa). Birakenewe gukurikiza uburyo bwiza bwo kugerwaho . Irashobora kandi gukoreshwa nka mixin.
Koresha urwego .text-hide
cyangwa kuvanga kugirango ufashe gusimbuza ibintu bigize inyandiko hamwe nishusho yinyuma.
Kugirango iterambere ryihuta-ryimikorere, koresha aya masomo yingirakamaro kugirango werekane kandi uhishe ibirimo ukoresheje ibikoresho ukoresheje itangazamakuru. Harimo kandi amasomo yingirakamaro yo guhinduranya ibintu iyo byacapwe.
Gerageza gukoresha ibi bigarukira kandi wirinde gukora verisiyo zitandukanye zurubuga rumwe. Ahubwo, koresha kugirango wuzuze buri gikoresho cyerekana.
Koresha kimwe cyangwa guhuza ibyiciro bihari kugirango uhindure ibintu hirya nohino.
Ibikoresho bito byiyongereyeTerefone (<768px) | Ibikoresho bitoIbinini (68768px) | Ibikoresho biciriritseIbiro (≥992px) | Ibikoresho bininiIbiro (≥1200px) | |
---|---|---|---|---|
.visible-xs-* |
Biboneka | Hihishe | Hihishe | Hihishe |
.visible-sm-* |
Hihishe | Biboneka | Hihishe | Hihishe |
.visible-md-* |
Hihishe | Hihishe | Biboneka | Hihishe |
.visible-lg-* |
Hihishe | Hihishe | Hihishe | Biboneka |
.hidden-xs |
Hihishe | Biboneka | Biboneka | Biboneka |
.hidden-sm |
Biboneka | Hihishe | Biboneka | Biboneka |
.hidden-md |
Biboneka | Biboneka | Hihishe | Biboneka |
.hidden-lg |
Biboneka | Biboneka | Biboneka | Hihishe |
Nko kuri v3.2.0, .visible-*-*
ibyiciro kuri buri cyiciro biza muburyo butatu, kimwe kuri buri display
mutungo wa CSS urutonde hepfo.
Itsinda ry'amasomo | CSSdisplay |
---|---|
.visible-*-block |
display: block; |
.visible-*-inline |
display: inline; |
.visible-*-inline-block |
display: inline-block; |
Noneho, kubindi byoroheje ( xs
) byerekanwa kurugero, .visible-*-*
ibyiciro bihari ni : .visible-xs-block
,, .visible-xs-inline
na .visible-xs-inline-block
.
Ibyiciro .visible-xs
,,, kandi birahari, ariko .visible-sm
birateshwa agaciro nka v3.2.0 . Bingana hafi , usibye nibindi bidasanzwe byihariye byo guhinduranya ibintu bifitanye isano..visible-md
.visible-lg
.visible-*-block
<table>
Bisa nibyiciro bisanzwe byitabira, koresha ibi kugirango uhindure ibintu kugirango bicapwe.
Amasomo | Mucukumbuzi | Icapa |
---|---|---|
.visible-print-block .visible-print-inline .visible-print-inline-block |
Hihishe | Biboneka |
.hidden-print |
Biboneka | Hihishe |
Icyiciro .visible-print
nacyo kirahari ariko cyataye agaciro guhera v3.2.0. Nibigereranyo bihwanye na .visible-print-block
, usibye nibindi bidasanzwe byihariye kubintu <table>
bifitanye isano.
Hindura amashusho yawe cyangwa umutwaro kubikoresho bitandukanye kugirango ugerageze ibyiciro byingirakamaro.
Icyatsi kibisi cyerekana ikintu kigaragara muburyo bwawe bwo kureba.
Hano, icyatsi kibisi nacyo cyerekana ikintu cyihishe muburyo bwawe bwo kureba.
CSS ya Bootstrap yubatswe kuri Buke, progaramu itunganijwe hamwe nibikorwa byinyongera nkibihinduka, ivanga, nibikorwa byo gukusanya CSS. Abashaka gukoresha inkomoko Idosiye nkeya aho kuba dosiye yacu ya CSS yakusanyije barashobora gukoresha impinduka nyinshi hamwe na mixin dukoresha murwego rwose.
Impinduka za gride hamwe nivanga bitwikiriye mugice cya sisitemu .
Bootstrap irashobora gukoreshwa byibuze muburyo bubiri: hamwe na CSS yakozwe cyangwa hamwe ninkomoko Idosiye nkeya. Gukusanya amadosiye make, baza Igice cyo Gutangira uburyo bwo gushiraho ibidukikije byiterambere kugirango ukore amategeko akenewe.
Igice cya gatatu cyo gukusanya ibikoresho gishobora gukorana na Bootstrap, ariko ntibishyigikiwe nitsinda ryacu ryibanze.
Ibihinduka bikoreshwa mumushinga wose nkuburyo bwo guhuza no gusangira indangagaciro zikoreshwa nkamabara, intera, cyangwa imyandikire yimyandikire. Kumeneka yuzuye, nyamuneka reba Customizer .
Byoroshye gukoresha ikoreshwa ryamabara abiri: ibara ryinshi nubusobanuro. Ibara rya graycale ritanga uburyo bwihuse kubisanzwe bikoreshwa mugicucu cyumukara mugihe ibisobanuro birimo amabara atandukanye yahawe agaciro keza.
Koresha icyaricyo cyose cyamabara ahindagurika uko ari cyangwa uyohereze kubindi bisobanuro bihinduka kumushinga wawe.
Intoki zingirakamaro kugirango uhindure byihuse ibintu byingenzi bigize skeleton yurubuga rwawe.
Byoroshye gutunganya amahuza yawe hamwe nibara ryiza hamwe nagaciro kamwe gusa.
Menya ko @link-hover-color
ikoresha imikorere, ikindi gikoresho giteye ubwoba kuva Gito, kugirango uhite ukora ibara ryiburyo ryiza. Urashobora gukoresha darken
,,, lighten
na saturate
.desaturate
Byoroshye gushiraho imyandikire yawe, ingano yinyandiko, kuyobora, nibindi byinshi hamwe na bike bihinduka. Bootstrap ikoresha ibyo kimwe kugirango itange imashini yoroshye.
Ibintu bibiri byihuse kugirango uhindure ahantu hamwe nizina ryizina ryibishushanyo byawe.
Ibigize muri Bootstrap ikoresha bimwe mubihinduka kugirango ushireho indangagaciro. Hano harakoreshwa cyane.
Abacuruzi bavanga ni imvange kugirango ifashe gushyigikira mushakisha nyinshi ushizemo ibicuruzwa byose byabacuruzi bijyanye na CSS yawe.
Ongera usubize ibice byawe 'agasanduku k'icyitegererezo hamwe na mixin imwe. Kubireba, reba iyi ngingo ifasha kuva muri Mozilla .
Ivanga ryataye agaciro guhera kuri v3.2.0, hamwe no gutangiza Autoprefixer. Kugirango ubungabunge inyuma-guhuza, Bootstrap izakomeza gukoresha mixin imbere kugeza Bootstrap v4.
Uyu munsi mushakisha zose zigezweho zishyigikira border-radius
imitungo idateganijwe. Nkibyo, nta .border-radius()
mixin, ariko Bootstrap ikubiyemo shortcuts zo kuzenguruka vuba impande ebyiri kuruhande runaka rwikintu.
Niba abo ukurikirana ukoresha amashusho agezweho kandi akomeye kandi akomeye, menya neza gukoresha box-shadow
umutungo wenyine. Niba ukeneye inkunga ya Android ishaje (pre-v4) hamwe nibikoresho bya iOS (pre-iOS 5), koresha mixin itaye agaciro kugirango utore -webkit
prefix isabwa.
Ivanga ryataye agaciro guhera kuri v3.1.0, kubera ko Bootstrap idashyigikira kumugaragaro urubuga rushaje rudashyigikira umutungo usanzwe. Kugirango ubungabunge inyuma-guhuza, Bootstrap izakomeza gukoresha mixin imbere kugeza Bootstrap v4.
Witondere gukoresha rgba()
amabara mugasanduku kawe kugirango uhuze kuburyo bushoboka hamwe ninyuma.
Imvange nyinshi zo guhinduka. Shiraho amakuru yinzibacyuho yose hamwe, cyangwa ugaragaze gutinda nigihe kirekire nkuko bikenewe.
Imvange zateshejwe agaciro nka v3.2.0, hamwe no gutangiza Autoprefixer. Kugirango ubungabunge inyuma-guhuza, Bootstrap izakomeza gukoresha imvange imbere kugeza Bootstrap v4.
Kuzenguruka, gupima, guhindura (kwimuka), cyangwa kugoreka ikintu icyo aricyo cyose.
Imvange zateshejwe agaciro nka v3.2.0, hamwe no gutangiza Autoprefixer. Kugirango ubungabunge inyuma-guhuza, Bootstrap izakomeza gukoresha imvange imbere kugeza Bootstrap v4.
Imvange imwe yo gukoresha ibintu byose bya animasiyo ya CSS3 muri déclaration imwe nindi ivanga kubintu byihariye.
Imvange zateshejwe agaciro nka v3.2.0, hamwe no gutangiza Autoprefixer. Kugirango ubungabunge inyuma-guhuza, Bootstrap izakomeza gukoresha imvange imbere kugeza Bootstrap v4.
Shiraho opacite kuri mushakisha zose hanyuma utange filter
kugaruka kuri IE8.
Tanga imiterere yo kugenzura imiterere muri buri murima.
Gukora inkingi ukoresheje CSS mubintu bimwe.
Byoroshye guhindura amabara ayo ari yo yose muburyo bwinyuma. Shaka byinshi kandi ushireho icyerekezo, koresha amabara atatu, cyangwa ukoreshe radiyo ya radiyo. Hamwe na mixin imwe ubona ibisobanuro byose byateganijwe uzakenera.
Urashobora kandi kwerekana inguni yibisanzwe bibiri-amabara, umurongo ugereranya:
Niba ukeneye kogosha-umurongo wuburyo bwa gradient, ibyo biroroshye, kandi. Gusa vuga ibara rimwe hanyuma tuzarengere umurongo wera usobanutse.
Hejuru ya ante hanyuma ukoreshe amabara atatu aho. Shiraho ibara ryambere, ibara rya kabiri, ibara rya kabiri ibara rihagarara (agaciro k'ijanisha nka 25%), naho ibara rya gatatu hamwe n'uruvange:
Umutwe! Mugihe ukeneye gukuraho gradient, menya neza gukuraho IE yihariye filter
ushobora kuba wongeyeho. Urashobora kubikora ukoresheje .reset-filter()
mixin kuruhande background-image: none;
.
Imikoreshereze yingirakamaro ni ivanga rihuza ubundi umutungo wa CSS udafitanye isano kugirango ugere ku ntego cyangwa umurimo runaka.
Wibagiwe kongeramo class="clearfix"
ikintu icyo aricyo cyose hanyuma wongereho .clearfix()
mixin aho bikenewe. Koresha micro clearfix kuva Nicolas Gallagher .
Byihuse shyira ikintu icyo aricyo cyose mubabyeyi. Irasaba width
cyangwa max-width
gushyirwaho.
Kugaragaza ibipimo byikintu byoroshye.
Byoroshye gushiraho uburyo bwo guhindura imiterere ya textarea iyariyo yose, cyangwa ikindi kintu icyo aricyo cyose. Mburabuzi imyitwarire isanzwe ya mushakisha ( both
).
Byoroshye kugabanya inyandiko hamwe na ellipsis hamwe na mixin imwe. Irasaba ikintu kuba block
cyangwa inline-block
urwego.
Kugaragaza inzira ebyiri zishusho hamwe nubunini bwa @ 1x, kandi Bootstrap izatanga ikibazo cya @ 2x itangazamakuru. Niba ufite amashusho menshi yo gukora, tekereza kwandika ishusho yawe ya retina CSS intoki mubibazo bimwe byitangazamakuru.
Mugihe Bootstrap yubatswe kuri Less, ifite kandi icyambu cya Sass cyemewe . Turayibungabunga mububiko butandukanye bwa GitHub kandi dukoresha ibishya hamwe ninyandiko yo guhindura.
Kubera ko icyambu cya Sass gifite repo itandukanye kandi ikorera abayumva batandukanye, ibiri mumushinga bitandukanye cyane numushinga mukuru wa Bootstrap. Ibi byemeza ko icyambu cya Sass gihuye na sisitemu nyinshi zishingiye kuri Sass.
Inzira | Ibisobanuro |
---|---|
lib/ |
Kode ya amabuye y'agaciro (Iboneza rya Sass, Rail na Compass integrated) |
tasks/ |
Guhindura inyandiko (guhindukira hejuru Hasi Kuri Sass) |
test/ |
Ibizamini byo gukusanya |
templates/ |
Porogaramu ya compass igaragara |
vendor/assets/ |
Sass, JavaScript, na dosiye yimyandikire |
Rakefile |
Imirimo y'imbere, nka rake no guhindura |
Sura ububiko bwa Sass port ya GitHub kugirango urebe amadosiye akora.
Kumakuru yukuntu washyiraho no gukoresha Bootstrap kuri Sass, baza ububiko bwa GitHub . Nibisanzwe bigezweho kandi bikubiyemo amakuru yo gukoresha hamwe na Rail, Compass, hamwe nimishinga isanzwe ya Sass.