Ndiyaqalisa
Isishwankathelo seBootstrap, indlela yokukhuphela kunye nokusetyenziswa, iitemplates ezisisiseko kunye nemizekelo, kunye nokunye.
Isishwankathelo seBootstrap, indlela yokukhuphela kunye nokusetyenziswa, iitemplates ezisisiseko kunye nemizekelo, kunye nokunye.
I-Bootstrap (okwangoku i-v3.3.7) ineendlela ezimbalwa ezilula zokuqalisa ngokukhawuleza, nganye ibhenela kwinqanaba lesakhono esahlukileyo kunye nemeko yokusetyenziswa. Funda ukuze ubone oko kuhambelana neemfuno zakho.
Iqulunqwe yaza yacuthwa iCSS, iJavaScript, kunye neefonti. Akukho maxwebhu okanye iifayile zoqobo ezibandakanyiweyo.
Umthombo omncinci, iJavaScript, kunye neefayile zefonti, kunye namaxwebhu ethu. Ifuna Umqokeleli omncinci kunye nokuseta okuthile.
I-Bootstrap efakwe kwi-Less ukuya kwi-Sass ukuze ifakwe lula kwi-Rails, Compass, okanye iiprojekthi ze-Sass kuphela.
Abantu abangaphaya e- jsDelivr babonelela ngenkxaso ye-CDN ye-Bootstrap's CSS kunye neJavaScript. Sebenzisa nje la makhonkco e- Bootstrap CDN .
Unokufaka kwaye ulawule iBootstrap's Ngaphantsi, iCSS, iJavaScript, kunye neefonti usebenzisa iBower :
Unako kwakhona ukufaka iBootstrap usebenzisa npm :
require('bootstrap')
izakulayisha zonke iiplagi zeBootstrap zejQuery kwinto yejQuery. Imodyuli bootstrap
ngokwayo ayithumeleli nantoni na. Uyakwazi ukulayisha ngesandla iiplagi ze-Bootstrap zejQuery nganye ngokulayisha /js/*.js
iifayile phantsi kolawulo lomgangatho ophezulu wephakheji.
I-Bootstrap's package.json
iqulethe i-metadata eyongezelelweyo phantsi kwezi zitshixo zilandelayo:
less
- indlela eya kwiBootstrap eyona fayile yomthombo omncincistyle
-indlela eya kwi-Bootstrap's non-minified CSS eye yaqulunqwa kusetyenziswa useto olungagqibekanga (akukho ngokwezifiso)Ungafaka kwaye ulawule iBootstrap's Ngaphantsi, iCSS, iJavaScript, kunye neefonti usebenzisa uMqambi :
I- Bootstrap isebenzisa i -Autoprefixer ukujongana nezimaphambili zomthengisi we-CSS . Ukuba uqulunqa iBootstrap kumthombo wayo oNgaphantsi/Sass kwaye awusebenzisi iGruntfile yethu, kuya kufuneka udibanise iAutoprefixer kwinkqubo yakho yokwakha ngokwakho. Ukuba usebenzisa i-Bootstrap ehlanganiswe kwangaphambili okanye usebenzisa iGruntfile yethu, awudingi kuba naxhala malunga noku kuba i-Autoprefixer sele idityanisiwe kwiGruntfile yethu.
I-Bootstrap inokukhutshelwa ngeendlela ezimbini, apho uya kufumana abalawuli balandelayo kunye neefayile, ngokufanelekileyo ukuqokelela izixhobo eziqhelekileyo kunye nokubonelela kokubili okudityanisiweyo kunye nokwahluka okwenziwa kancinci.
Nceda uqaphele ukuba zonke iiplagi zeJavaScript zifuna ukuba i-jQuery ifakwe, njengoko kubonisiwe kwitemplate yokuqalisa . Qhagamshelana nathibower.json
ukuze ubone ukuba zeziphi iinguqulelo zejQuery ezixhaswayo.
Nje ukuba ukhutshelwe, vula isiqulathi seefayili esicinezelweyo ukuze ubone ulwakhiwo lwe (oluhlanganisiweyo) lweBootstrap. Uya kubona into efana nale:
Le yeyona ndlela isisiseko yeBootstrap: iifayile eziqulunqwe kwangaphambili zosetyenziso olukhawulezayo lokuthoba phantse kuyo nayiphi na iprojekthi yewebhu. Sinikezela nge-CSS kunye ne-JS ( bootstrap.*
) ehlanganisiweyo, kunye ne-CSS ehlanganisiweyo kunye ne-JS ( bootstrap.min.*
). Iimephu zemvelaphi yeCSS ( bootstrap.*.map
) ziyafumaneka ukuze zisetyenziswe nezikhangeli ezithile izixhobo zomphuhlisi. Iifonti ezisuka kwiGlyphicons zibandakanyiwe, njengoko kunjalo nomxholo weBootstrap oyikhethayo.
Ukhuphelo lwekhowudi yomthombo weBootstrap luquka i-CSS esele iqulunqwe, iJavaScript, kunye nempahla yefonti, kunye nomthombo oNgaphantsi, iJavaScript, kunye namaxwebhu. Ngokukodwa ngakumbi, kubandakanya oku kulandelayo kunye nokunye:
I less/
, js/
, kwaye fonts/
ziyikhowudi yemvelaphi yethu CSS, JS, kunye neefonti ze icon (ngokulandelelana). Isiqulathi dist/
seefayili sibandakanya yonke into edwelisiweyo kwicandelo lokhuphelo oluqokelelweyo ngasentla. Ifolda docs/
ibandakanya ikhowudi yemvelaphi yamaxwebhu ethu, kunye examples/
nokusetyenziswa kweBootstrap. Ngaphaya koko, nayiphi na enye ifayile efakiweyo ibonelela ngenkxaso yeepakethe, ulwazi lwelayisenisi, kunye nophuhliso.
I- Bootstrap isebenzisa i- Grunt yenkqubo yayo yokwakha, kunye neendlela ezifanelekileyo zokusebenza kunye nesakhelo. Yindlela esiqokelela ngayo ikhowudi yethu, siqhuba iimvavanyo, nokunye.
Ukufakela i-Grunt, kufuneka uqale ukhuphele kwaye ufake i-node.js (ebandakanya i-npm). I-npm imele iimodyuli ezipakishiweyo zenode kwaye yindlela yokulawula ukuxhomekeka kophuhliso ngokusebenzisa i-node.js.
Emva koko, ukusuka kumgca womyalelo:grunt-cli
kwihlabathi jikelele nge npm install -g grunt-cli
./bootstrap/
, emva koko ubaleke npm install
. npm iya kujonga package.json
ifayile kwaye ifake ngokuzenzekelayo ukuxhomekeka okuyimfuneko kwendawo edweliswe apho.Xa ugqityiwe, uya kukwazi ukuqhuba imiyalelo eyahlukeneyo yeGrunt enikwe kumgca womyalelo.
grunt dist
(Hlanganisa iCSS kunye neJavaScript)Yenza kwakhona /dist/
uvimba weefayili kunye neefayile zeCSS ezihlanganisiweyo kunye neJavaScript. Njengomsebenzisi we-Bootstrap, lo ngokuqhelekileyo ngumyalelo owufunayo.
grunt watch
(Bukela)Ukubukela iifayile zomthombo oMncinci kwaye uziqokelele ngokuzenzekelayo kwi-CSS nanini na ugcina utshintsho.
grunt test
(Yenza iimvavanyo)Iqhuba i-JSHint kwaye iqhuba iimvavanyo ze-QUnit ngaphandle kwentloko kwi - PhantomJS .
grunt docs
(Yakha kwaye uvavanye ii-asethi zamaxwebhu)Yakha kwaye ivavanye i-CSS, iJavaScript, kunye nezinye ii-asethi ezisetyenziswa xa kuqhutywa uxwebhu ekuhlaleni nge bundle exec jekyll serve
.
grunt
(Yakha yonke into kwaye uqhube iimvavanyo)Iqulunqa kwaye inciphise i-CSS kunye neJavaScript, yakha iwebhusayithi yamaxwebhu, iqhuba i-HTML5 yokuqinisekisa ngokuchasene nee-docs, ihlaziya kwakhona i-asethi ye-Customizer, kunye nokunye. Ifuna i- Jekyll . Ngokwesiqhelo kufuneka kuphela ukuba ugqekeza kwiBootstrap ngokwayo.
Ukuba udibana neengxaki ngokufaka ukuxhomekeka okanye ukusebenzisa imiyalelo ye-Grunt, qala ucime /node_modules/
uvimba weefayili owenziwe ngu-npm. Emva koko, phinda wenze npm install
.
Qala ngale template ye-HTML esisiseko, okanye ulungise le mizekelo . Siyathemba ukuba uya kuziqhelanisa neetemplates zethu kunye nemizekelo, uzilungise ukuze zihambelane neemfuno zakho.
Khuphela iHTML engezantsi ukuze uqalise ukusebenza ngoxwebhu oluncinci lweBootstrap.
Yakha kwithempleyithi esisiseko engasentla ngezinto ezininzi zeBootstrap. Siyakukhuthaza ukuba wenze ngokwezifiso kwaye ulungelelanise i-Bootstrap ukuze ihambelane neemfuno zeprojekthi yakho.
Fumana ikhowudi yemvelaphi kuwo wonke umzekelo ongezantsi ngokukhuphela indawo yokugcina iBootstrap . Imizekelo inokufumaneka kuluhlu docs/examples/
.
Akukho nto ngaphandle kwezinto ezisisiseko: i-CSS ehlanganisiweyo kunye neJavaScript kunye nesitya.
Yenza i-navbar yesiko kunye namakhonkco afanelekileyo. Iintloko phezulu! Hayi kakhulu Safari friendly.
I- Bootlint sisixhobo esisemthethweni se-Bootstrap HTML linter . Ijonga ngokuzenzekelayo iimpazamo ezininzi eziqhelekileyo ze-HTML kumaphepha ewebhu asebenzisa i-Bootstrap ngendlela efanelekileyo "ye-vanilla". Amacandelo/iwijethi zeVanilla Bootstrap zifuna ukuba iindawo zazo zeDOM zihambelane nezakhiwo ezithile. I-Bootlint ijonga ukuba imizekelo yamacandelo e-Bootstrap ine-HTML eyakhiwe ngokuchanekileyo. Cinga ukongeza iBootlint kwisixhobo sakho sophuhliso lwewebhu yeBootstrap ukuze kungabikho nanye yeempazamo eziqhelekileyo ezicothisa uphuhliso lweprojekthi yakho.
Hlala usexesheni kuphuhliso lweBootstrap kwaye ufikelele kuluntu ngezi zixhobo ziluncedo.
irc.freenode.net
kumncedisi, kwi ##bootstrap channel .twitter-bootstrap-3
.bootstrap
kwiipakethe ezitshintsha okanye zongeza kumsebenzi we-Bootstrap xa usasazwa nge- npm okanye iindlela zonikezelo ezifanayo zokufumana okuphezulu.Unokulandela @getbootstrap kwi-Twitter ngentlebendwane yamva nje kunye neevidiyo zomculo ezothusayo.
I-Bootstrap ilungelelanisa ngokuzenzekelayo amaphepha akho kwiisayizi ezahlukeneyo zesikrini. Nantsi indlela yokuvala eli nqaku ukuze iphepha lakho lisebenze njengalo mzekelo ungaphenduliyo .
<meta>
ekhankanywe kumaxwebhu eCSSwidth
legridi .container
ngalinye ngobubanzi obubodwa, umzekelo width: 970px !important;
Qinisekisa ukuba oku kuza emva kweCSS yeBootstrap engagqibekanga. Unokukhetha ukunqanda !important
ngemibuzo yemidiya okanye umkhethi-fu..col-xs-*
iiklasi ukongeza, okanye endaweni, eziphakathi/ezinkulu. Sukuba nexhala, isikali segridi yesixhobo esincinci kuzo zonke izisombululo.Uzakufuna i-Respond.js ye-IE8 (ekubeni imibuzo yethu yemidiya isekho kwaye ifuna ukuqwalaselwa). Oku kuvala "isiza esiphathwayo" imiba yeBootstrap.
Sisebenzise la manyathelo kumzekelo. Funda ikhowudi yemvelaphi yayo ukuze ubone utshintsho oluthile oluphunyeziweyo.
Ujonge ukufuduka kuguqulelo lwakudala lwe Bootstrap ukuya v3.x ? Jonga isikhokelo sethu sokufuduka .
I-Bootstrap yakhelwe ukusebenza ngcono kwidesktop yamva nje kunye neziphequluli eziphathwayo, okuthetha ukuba abakhangeli bakudala banokubonisa indlela eyahlukileyo, nangona isebenza ngokupheleleyo, unikezelo lwamacandelo athile.
Ngokukodwa, sixhasa iinguqulelo zamva nje zezibhrawuza kunye namaqonga alandelayo.
Iibrowser ezizezinye ezisebenzisa inguqulelo yamva nje yeWebKit, iBlink, okanye iGecko, nokuba ngokuthe ngqo okanye ngeplatform ye-API yokujonga iwebhu, ayixhaswanga ngokucacileyo. Nangona kunjalo, iBootstrap kufuneka (kwiimeko ezininzi) ibonise kwaye isebenze ngokuchanekileyo kwezi bhrawuza ngokunjalo. Ulwazi oluthe ngqo lwenkxaso lunikiwe ngezantsi.
Ngokubanzi, iBootstrap ixhasa iinguqulelo zamva nje zesikhangeli esikhulu seqonga ngalinye. Qaphela ukuba iibrowser zeproxy (ezifana ne-Opera Mini, imowudi ye-Opera Mobile ye-Turbo, i-UC Browser Mini, i-Amazon Silk) ayixhaswanga.
IChrome | IFirefox | Safari | |
---|---|---|---|
Android | Ixhasiwe | Ixhasiwe | N / A |
iOS | Ixhasiwe | Ixhasiwe | Ixhasiwe |
Ngokufanayo, iinguqulelo zamva nje zebrowser ezininzi zedesktop ziyaxhaswa.
IChrome | IFirefox | Internet Explorer | Opera | Safari | |
---|---|---|---|---|---|
IMac | Ixhasiwe | Ixhasiwe | N / A | Ixhasiwe | Ixhasiwe |
IiWindows | Ixhasiwe | Ixhasiwe | Ixhasiwe | Ixhasiwe | Ayixhaswa |
Kwi-Windows, sixhasa i-Internet Explorer 8-11 .
KwiFirefox, ukongeza kukhupho oluzinzileyo lwamva nje oluqhelekileyo, sikwaxhasa inguqulelo yamva nje yokukhutshwa kweNkxaso eYandisiweyo (ESR) yeFirefox.
Ngokungekho mthethweni, iBootstrap kufuneka ijonge kwaye iziphathe kakuhle ngokwaneleyo kwiChromium kunye neChrome yeLinux, iFirefox yeLinux, kunye ne-Internet Explorer 7, kunye neMicrosoft Edge, nangona ingaxhaswanga ngokusemthethweni.
Kuluhlu lwezinye iibhugi zebhrawuza ekufuneka iBootstrap ijongane nazo, bona iWall yethu yebugs zebrawuza .
I-Internet Explorer 8 kunye ne-9 nazo ziyaxhaswa, nangona kunjalo, nceda uqaphele ukuba ezinye iimpawu ze-CSS3 kunye neempawu ze-HTML5 azixhaswanga ngokupheleleyo ngaba bakhangeli. Ukongeza, i- Internet Explorer 8 ifuna ukusetyenziswa kwe- Respond.js ukunika inkxaso yemibuzo yemidiya.
Uphawu | I-Internet Explorer 8 | I-Internet Explorer 9 |
---|---|---|
border-radius |
Ayixhaswa | Ixhasiwe |
box-shadow |
Ayixhaswa | Ixhasiwe |
transform |
Ayixhaswa | Ixhaswa, -ms nesimaphambili |
transition |
Ayixhaswa | |
placeholder |
Ayixhaswa |
Ndwendwela Ngaba ndingasebenzisa... ngeenkcukacha malunga nenkxaso yesikhangeli seCSS3 kunye neHTML5.
Lumkela ezi zilumkiso zilandelayo xa usebenzisa i-Respond.js kuphuhliso lwakho kunye nemekobume yemveliso ye-Internet Explorer 8.
Ukusebenzisa i-Respond.js nge-CSS isingathwe kwindawo eyahlukileyo (engaphantsi) (umzekelo, kwi-CDN) ifuna ukuseta olongezelelweyo. Jonga i-Respond.js amaxwebhu ngeenkcukacha.
file://
Ngenxa yemithetho yokhuseleko lomkhangeli zincwadi, iRespond.js ayisebenzi kunye namaphepha ajongwe ngendlela file://
elandelwayo (njengaxa uvula ifayile yeHTML yendawo). Ukuvavanya iimpawu eziphendulayo kwi-IE8, jonga amaphepha akho ngaphezulu kwe-HTTP(S). Jonga i-Respond.js amaxwebhu ngeenkcukacha.
@import
I-Respond.js ayisebenzi nge-CSS ekubhekiselwa kuyo nge @import
. Ngokukodwa, ulungelelwaniso lweDrupal lwaziwa ngokusetyenziswa @import
. Jonga i-Respond.js amaxwebhu ngeenkcukacha.
IE8 ayixhasi ngokupheleleyo box-sizing: border-box;
xa idityaniswe ne min-width
, max-width
, min-height
, okanye max-height
. Ngeso sizathu, ukusukela kwi-v3.0.1, asisasebenzisi max-width
kwi- .container
s.
IE8 inemiba ethile @font-face
xa idibene ne :before
. I-Bootstrap isebenzisa loo ndibaniselwano kunye neeGlyphicons zayo. Ukuba iphepha livalelwe, kwaye lilayishwe ngaphandle kwemouse phezu kwefestile (okt betha iqhosha lokuhlaziya okanye layisha into ethile kwi-iframe) ngoko iphepha linikezelwa phambi kokuba ifonti ilayishwe. Ukushukuma phezu kwephepha (umzimba) kuya kubonisa ezinye zee-icon kunye nokuhamba phezu kwee-icon eziseleyo kuya kubonisa nazo. Jonga umba #13863 ngeenkcukacha.
I-Bootstrap ayixhaswanga kwiimowudi ezindala zokuhambelana ne-Internet Explorer. Ukuqinisekisa ukuba usebenzisa imowudi yonikezelo yamva nje ye-IE, cinga ukuquka <meta>
ithegi efanelekileyo kumaphepha akho:
Qinisekisa imodi yoxwebhu ngokuvula izixhobo zokulungisa: cinezela F12kwaye ukhangele "Imo yoXwebhu".
Le thegi ibandakanyiwe kuwo onke amaxwebhu eBootstrap kunye nemizekelo yokuqinisekisa unikezelo olungcono olunokwenzeka kuguqulelo ngalunye oluxhaswayo lwe-Internet Explorer.
Jonga lo mbuzo we-StackOverflow ngolwazi olungakumbi.
I-Internet Explorer 10 ayahluli ububanzi besixhobo kububanzi bendawo yokujonga , kwaye ayisebenzisi ngokufanelekileyo imibuzo yemidiya kwi-Bootstrap's CSS. Ngokwesiqhelo ungongeza i-snippet ekhawulezayo ye-CSS ukulungisa oku:
Nangona kunjalo, oku akusebenzi kwizixhobo ezisebenzisa iWindows Phone 8 iinguqulelo ezindala kunoHlaziyo lwe-3 (aka GDR3) , njengoko ibangela ukuba izixhobo ezinjalo zibonise ubukhulu becala imboniselo yedesktop endaweni yokujonga "ifowuni" emxinwa. Ukulungisa oku, kuya kufuneka uquke le CSS ilandelayo kunye neJavaScript ukuze usebenze malunga nebug .
Ngolwazi oluthe kratya kunye nezikhokelo zokusetyenziswa, funda iWindows Phone 8 kunye neDevice-Width .
Njengeentloko phezulu, sibandakanya oku kuwo onke amaxwebhu eBootstrap kunye nemizekelo njengomboniso.
I-injini yonikezelo lweenguqulelo zeSafari phambi kwe-v7.1 ye-OS X kunye neSafari ye-iOS v8.0 ibe nengxaki ngenani leendawo zedesimali ezisetyenziswa .col-*-1
kwiiklasi zethu zegridi. Ngoko ukuba uneekholamu ezili-12 zegridi nganye, uya kuqaphela ukuba zifike zamfutshane xa zithelekiswa neminye imiqolo yeekholamu. Ngaphandle kokuphucula iSafari/iOS, unokhetho oluthile lokusebenzela:
.pull-right
kwikholamu yakho yokugqibela yegridi ukuze ufumane ulungelelwaniso lwasekuneneInkxaso yento ilinganiselwe kakhulu kwi-iOS kunye ne-Android overflow: hidden
. <body>
Ukuza kuthi ga ngoku, xa uskrola udlule ngaphezulu okanye ezantsi kwemodali kuso nasiphi na isikhangeli sezixhobo, <body>
umxholo uya kuqalisa ukuskrola. Jonga i-Chrome bug #175502 (ilungiswe kwi-Chrome v40) kunye ne- WebKit bug #153852 .
Ukususela kwi-iOS 9.3, ngelixa i-modal ivuliwe, ukuba i-touch yokuqala ye-scrolling gesture ingaphakathi komda wesicatshulwa <input>
okanye i- <textarea>
, <body>
umxholo ongaphantsi kwe-modal uya kuskrolwa endaweni ye-modal ngokwayo. Jonga i-WebKit bug #153856 .
Kwakhona, qaphela ukuba usebenzisa i-navbar esisigxina okanye usebenzisa amagalelo ngaphakathi kwe-modal, i-iOS ine-bug yonikezelo engahlaziyiyo indawo yezinto ezisisigxina xa ikhibhodi ebonakalayo iqaliswa. Iindlela ezimbalwa zokusebenzela ezi zibandakanya ukuguqula izinto zakho zibe position: absolute
okanye ukubhenela isibali-xesha ekugxininiseni ukuzama ukulungisa indlela omi ngayo ngesandla. Oku akuphathwa yiBootstrap, ke kukuwe ukuba uthathe isigqibo sokuba sesiphi isisombululo esifanelekileyo kwisicelo sakho.
Into .dropdown-backdrop
ayisetyenziswanga kwi-iOS kwi-nav ngenxa yobunzima be-z-indexing. Ke, ukuvala ukwehla kwii-navbar, kufuneka ucofe ngokuthe ngqo into eyehlayo (okanye nayiphi na enye into eya kutshisa isiganeko sokucofa kwi-iOS ).
Usondezo lwephepha lubonisa ngokungenakuthintelwa unikezelo lwezinto zakudala kwezinye iindawo, zombini kwiBootstrap nakwiwebhu iyonke. Ngokuxhomekeke kumcimbi, singakwazi ukuwulungisa (khangela kuqala kwaye uvule umba ukuba kukho imfuneko). Nangona kunjalo, sikholisa ukungazihoyi ezi njengoko zihlala zingenaso sisombululo sithe ngqo ngaphandle kwee-hacky workarounds.
:hover
/ :focus
kwiselfowuniNangona i-hovering yokwenyani ingenzeki kwizikrini ezininzi zokuchukumisa, uninzi lwezikhangeli eziphathwayo zixelisa inkxaso ye-hovering kwaye zenze :hover
"incangathi". Ngamanye amagama, :hover
izitayile ziqala ukusebenza emva kokucofa into kwaye uyeke ukusebenzisa emva kokuba umsebenzisi echwethe enye into. Oku kunokubangela ukuba amazwe e-Bootstrap :hover
"abambeke" ngendlela engathandekiyo kwizikhangeli ezinjalo. Ezinye iibrowser eziphathwayo nazo zenza :focus
incangathi efanayo. Okwangoku akukho ndlela ilula yokwenza le miba ngaphandle kokususa izimbo ezinjalo ngokupheleleyo.
Nakwezinye iibrowsers zanamhlanje, ukuprinta kunokuba nzima.
Ngokukodwa, njenge-Chrome v32 kwaye kungakhathaliseki ukuba kuseto lwemida, iChrome isebenzisa ububanzi bendawo yokujonga incinci kakhulu kunobukhulu bephepha lomzimba xa isombulula imibuzo yemidiya ngelixa ushicilela iphepha lewebhu. Oku kunokukhokelela ekubeni igridi yeBootstrap encinci isebenze ngokungalindelekanga xa kushicilelwa. Bona umba #12078 kunye Chrome bug #273306 ezinye iinkcukacha. Iindlela zokulungisa ezicetyiswayo:
@screen-*
okuguquguquka okuNcinci ukuze iphepha lakho lomshicileli lithathwe likhulu kunelo elincinane kakhulu.Kwakhona, njengeSafari v8.0, ububanzi obumiselweyo .container
s kunokubangela ukuba iSafari isebenzise ubungakanani befonti encinci ngokungaqhelekanga xa kushicilelwa. Bona #14868 kunye ne- WebKit bug #138192 ngeenkcukacha ezithe vetshe. Enye indlela enokuthi isebenze koku kukongeza le CSS ilandelayo:
Ngaphandle kwebhokisi, i-Android 4.1 (kunye nokunye okukhutshiweyo okutsha ngokucacileyo) ngenqanawa kunye ne-Browser app njengesikhangeli sewebhu esikhethiweyo (ngokuchaseneyo neChrome). Ngelishwa, usetyenziso lweSikhangeli luneempazamo ezininzi kunye nokungahambelani neCSS ngokubanzi.
Kwizinto <select>
, isikhangeli sesitokhwe se-Android asiyi kubonisa ulawulo olusecaleni ukuba kukho border-radius
kunye/okanye border
kusetyenziswe. (Jonga lo mbuzo we-StackOverflow ngeenkcukacha.) Sebenzisa i-snippet yekhowudi engezantsi ukususa i-CSS ekhubekisayo kwaye <select>
unikeze njengento engabhalwanga kwisikhangeli sesitokhwe se-Android. Umsebenzisi othungayo unqanda ukuphazamisana neChrome, iSafari, kunye nezikhangeli zeMozilla.
Ngaba ufuna ukubona umzekelo? Jonga le demo yeJS Bin.
Ukuze unikeze amava angcono kakhulu kwiziphequluli ezindala kunye ne-buggy, i-Bootstrap isebenzisa i - CSS i-hacks ye-browser kwiindawo ezininzi ukujolisa i-CSS ekhethekileyo kwiinguqulelo ezithile zebrawuza ukuze isebenze malunga neebhugi kwizikhangeli ngokwazo. Ezi hacks ngokuqondakalayo zibangela ukuba abaqinisekisi beCSS bakhalaze ukuba abakho mthethweni. Kwiindawo ezimbalwa, sikwasebenzisa iimpawu ze-CSS ezophayo ezingekamiswa ngokupheleleyo, kodwa ezi zisetyenziselwa uphuculo oluqhubekayo.
Ezi zilumkiso zokuqinisekisa azinamsebenzi xa kusenziwa oko ekubeni icandelo elingenabuqhophololo le-CSS yethu liqinisekisa ngokupheleleyo kwaye izahlulo ezikhohlisayo aziphazamisi ukusebenza kakuhle kwenxalenye engeyiyo i-hacky, kungoko sityeshela ngabom ezi zilumkiso.
Amaxwebhu ethu e-HTML nawo anezilumkiso ezingenamsebenzi nezingabalulekanga zokuqinisekiswa kwe-HTML ngenxa yokufakwa kwethu kwenkqubo ethile ye -Firefox bug .
Ngelixa singaxhasi ngokusemthethweni naziphi na iiplagi zomntu wesithathu okanye izongezo, sinikeza iingcebiso eziluncedo ukukunceda ukuthintela imiba enokubakho kwiiprojekthi zakho.
Enye isoftware yomntu wesithathu, kuquka iGoogle Maps kunye neGoogle Custom Search Engine, ingquzulwano neBootstrap ngenxa * { box-sizing: border-box; }
, umthetho owenza ukuba kube njalo padding
awuchaphazeli ububanzi bokugqibela obubaliweyo bento. Funda ngakumbi malunga nemodeli yebhokisi kunye nokulinganisa kwiCSS Tricks .
Ngokuxhomekeke kumxholo, ungabhala ngaphezulu njengoko kufuneka (Ukhetho 1) okanye usete ngokutsha ubungakanani bebhokisi kwingingqi yonke (Ukhetho 2).
I-Bootstrap ilandela imigangatho yewebhu eqhelekileyo kwaye-ngomzamo omncinci owongezelelweyo-inokusetyenziswa ukwenza iisayithi ezifikelelekayo kwabo basebenzisa i -AT .
Ukuba ukuhamba kwakho kuqulethe izixhumanisi ezininzi kwaye kuza phambi komxholo oyintloko kwi-DOM, yongeza Skip to main content
ikhonkco phambi kokukhangela (ukufumana inkcazo elula, jonga eli nqaku leProjekthi ye-A11Y kwi-skip navigation links ). Ukusebenzisa .sr-only
iklasi kuya kufihla ikhonkco lokutsiba ngokubonakalayo, kwaye .sr-only-focusable
iklasi iya kuqinisekisa ukuba ikhonkco liyabonakala xa sele ligxilile (kubasebenzisi bekhibhodi ababonayo).
Ngenxa yokungaphumeleli kwexesha elide / iibhugi kwiChrome (jonga i-262171 kwi-Chromium bug tracker ) kunye ne-Internet Explorer (jonga eli nqaku kwiikhonkco zekhasi kunye nomyalelo wokugxila ), kuya kufuneka uqinisekise ukuba ekujoliswe kuyo kwikhonkco lakho lokutsiba. iqwalaselwe noko ngokwenkqubo ngokongeza tabindex="-1"
.
Ukongeza, unokufuna ukucinezela ngokucacileyo isalathisi esibonakalayo kwithagethi (ingakumbi njengoko iChrome okwangoku iphinda ibeke ugxininiso kwizinto tabindex="-1"
xa zicofa imouse) nge #content:focus { outline: none; }
.
Qaphela ukuba le bug iyakuchaphazela nawaphi na amanye amakhonkco angaphakathi kwiphepha enokuthi isetyenziswe yisayithi yakho, ibenza bangabi namsebenzi kubasebenzisi bebhodi yezitshixo. Unokucinga ngokongeza ulungiso olufanayo lokumisa umsantsa kuzo zonke ezinye iiankile ezibiziweyo / iziphawuli zamaqhekeza ezisebenza njengeethagethi zekhonkco.
Xa ulungiselela izihloko ( <h1>
- <h6>
), isihloko sakho sokuqala soxwebhu kufuneka sibe yi <h1>
. Izihloko ezilandelayo kufuneka zenze usetyenziso olunengqiqo <h2>
- <h6>
olokuba abafundi besikrini banokwakha itheyibhile yemixholo yamaphepha akho.
Funda ngakumbi kwi- HTML CodeSniffer kunye ne -Penn State's AccessAbility .
Okwangoku, eminye imidibaniso yombala engagqibekanga ekhoyo kwiBootstrap (ezifana neeklasi ezahlukeneyo ezineqhosha elinesitayile, enye yekhowudi ephawula imibala esetyenziswa kwiibhloko zekhowudi ezisisiseko , iklasi yomncedi .bg-primary
wemeko yangasemva , kunye nombala wekhonkco ongagqibekanga xa usetyenziswa kwimvelaphi emhlophe) ube nomlinganiselo ophantsi wokuchasana (ngaphantsi komlinganiselo ocetyiswayo we-4.5:1 ). Oku kunokubangela iingxaki kubasebenzisi abanombono ophantsi okanye abangaboniyo ngemibala. Le mibala engagqibekanga ingafuna ukulungiswa ukwandisa umahluko kunye nokufundeka kwayo.
I-Bootstrap ikhutshwe phantsi kwelayisenisi ye-MIT kwaye i-copyright ye-2016 Twitter. Ukubiliswa kwiinqununu ezincinci, kunokuchazwa kunye neemeko ezilandelayo.
Ilayisensi epheleleyo yeBootstrap ibekwe kwindawo yokugcina iprojekthi ngolwazi oluthe kratya.
Amalungu oluntu aguqulele amaxwebhu e-Bootstrap kwiilwimi ezahlukeneyo. Akukho nanye exhaswa ngokusemthethweni kwaye ayinakuhlala ihlaziyiwe.
Asincedi ekuququzeleleni okanye ekusingatheni iinguqulelo, sidibanisa nje kuzo.
Ugqibile inguqulelo entsha okanye engcono? Vula isicelo sokutsala ukuyongeza kuluhlu lwethu.